|
Yeah, I didn't know you could use new with value types either. I guess I've just never tried.
|
|
|
|
|
hi guys!
need some help..
i have to make a management console type application which will install software on remote machines in a network .. using c#
can any one tell me where to start from..any useful links or tutorial etc..
will using winsock is a good idea?
abhinav
|
|
|
|
|
Hi.
I have created a class that read data from the database and i want to display this data on labels.
here is my class
public void SeachProduct(string PBarcode,string PName,string PPrice)
{
Barcode = PBarcode;
ProductName = PName;
Price = PPrice;
SqlConnection conn1 = new SqlConnection();
conn1.ConnectionString = "integrated security=SSPI;initial catalog=Phusa;server = za211149;persist security info=False";
conn1.Open();
try
{
SqlCommand cmdSearch1 = new SqlCommand();
cmdSearch1.Connection = conn1;
cmdSearch1.CommandText = "SELECT ProductName,Price FROM Products WHERE Barcode=@Barcode";
SqlParameter Bar = new SqlParameter();
Bar.ParameterName = "@Barcode";
Bar.Direction = System.Data.ParameterDirection.Input;
Bar.Value = Barcode;
cmdSearch1.Parameters.Add(Bar);
SqlParameter Nam1 = new SqlParameter();
Nam1.ParameterName="@ProductName";
Nam1.Direction = System.Data.ParameterDirection.Output;
Nam1.Value =ProductName;
cmdSearch1.Parameters.Add(Nam1);
SqlParameter Pri= new SqlParameter();
Pri.ParameterName = "@Price";
Pri.Direction = System.Data.ParameterDirection.Output;
Pri.Value = Price;
cmdSearch1.Parameters.Add(Pri);
SqlDataReader dr1 =cmdSearch1.ExecuteReader();
if(dr1.Read()==true)
{
//MessageBox.Show("Product found");
ProductName= dr1["ProductName"].ToString();
Price = dr1["Price"].ToString();
}
else
{
MessageBox.Show("Product not found");
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
conn1.Close();
}
and here i am try to call so that it can display data on the labels my class on form
SearchCustomers search = new SearchCustomers();
string Barcode;
string ProductName="";
string Price = "";
Barcode = txtBarcode.Text;
search.SeachProduct(Barcode,ProductName,Price);
lblProductName.Text = ProductName;
lblPrice.Text =Price;
}
-- modified at 4:03 Thursday 17th August, 2006
|
|
|
|
|
To make your code work as it is now, you have to use the "ref" keyword on the parameters, so that the method can change the strings that you send into it:
public void SeachProduct(string PBarcode, ref string PName, ref string PPrice)
and
search.SeachProduct(Barcode, ref ProductName, ref Price);
To use reference parameters in this ways is rarely used, though. Store the values in the search object instead, and expose them through properties.
---
b { font-weight: normal; }
|
|
|
|
|
I can't create uninstal project in my .NET 2003 Setup and Deployment Project. How can I do it?
Thank you for your help...
This is my sign
|
|
|
|
|
Hello
Wait a minute!! I thought setp program does that for you?!! Check the Add/Remove programs in the control panel after you install your app. Otherwise why would you make a setup?!!!
Regards
|
|
|
|
|
I am displaying images in my application. I want to display the images dynamically by assigning absolute path to the image controls. When i deploy my application in the web server, i could'nt view the images in the browser since it checks for the clients local path. How to solve this.
Thanks in advance.
Saravanan. P
|
|
|
|
|
This is a web app ? If so, how are you managing to load images locally ? If not, how are you loading them and how does the server fit in ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for immediate reply.it is web app developed using c#.i am dynamically assigning the absolute image path ( like c:/bat.gif ) to image controls at runtime.after depolying, my app is searching for bat.gif in client machine but i want my app to search for bat.gif in server machine and display it.How can i do it.
|
|
|
|
|
You need to point to the images using the path to the server, such as www.mysite.com/images/img.gif. If you put a local path, then you'll get a local path.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Any images that you want to display have to be accessible through the web server. You have to use the virtual address of the image, not the physical address, as the browser will be getting the image through the web server, not through the file system.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for immediate reply.
|
|
|
|
|
Hi all,
Is it possible to send a file directly to a printer in C#?
Thank you in advance.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Can any one please tell me how to implement flat files with NHibernate. I dont want to use the database with NHibernate. I wanted to use the flat files to save the data using the NHibernate.
Rakesh
|
|
|
|
|
plz any body tell me how i can add items to listview control with a sample C# project.
|
|
|
|
|
|
use a ListViewItem property for the list view u have
ListViewItem item;
item=new ListViewItem("cchandru");
items.SubItems.Add("kanth");
YourListviewControlName.Items.Add(item);
even i had this problem before..lol
cheers,
Chandru.
|
|
|
|
|
how i can add bitmap images to ListView Control e.g Folder Image
plz give me an idea about that.
thanx
|
|
|
|
|
u have to add a image list to the listview control property and then in the list view item property u add the image.
ListViewItem item;
item = new ListViewItem("Chandru",O);
/*
tht zero represents the image tht has to be added to this column from ur image list
0 -> 1st image in ur image list collection
1 -> second image.
*/
Am i clear to u?
|
|
|
|
|
I implemented an ActiveX control in C#. The interface looks like this:
public delegate void FooDelegate(string bar);
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface IMyActiveX
{
// ...
event FooDelegate Foobar;
}
Now, I'm stuck. I've got a client application for my control written in C++ / MFC and I can't figure out how to subscribe to the event.
Anyone?
-----------------
Alex
|
|
|
|
|
Is it possible to determine programmatically whether a perticular software is installed in our system.
For Example
I need to know whether MS Office is Installed in my PC Using C#
If u have solution for this perticular problem then reply me soon with sample Application in c#
|
|
|
|
|
Yes, it's possible.
Check COM object by GUID or COM-interface name in registry.
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
Hi guys,
I want to add a load screen in my application. How can I make a load screen appear with percentage while my application is doing its job at background ?
Thanks for your helps and best regards !
.:: Something is Wrong ::.
|
|
|
|
|
Hi,
First of all what do you mean by -
pashje wrote: add a load screen
I guess you want to show a progress bar or some thing like that ?
If i am correct you will have to add multi-threading into ur application, wherein your progress bar will be in some other thread than ur application and would update as you complete the tasks in the application.
You will need some communication medium between the two threads such as global variables ( for example ).
Hope i guessed correctly !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
Yep, you are right.. All I need is that! But my problem is with that percentage. I mean how should I make the progress bar increment correctly (for instance the job working on background will accomplished after 50 sec.. then every second my progress bar will increment 2 percent. but actually my program do not know how many seconds the job will take.. so just make a guess ? )
.:: Something is Wrong ::.
|
|
|
|