|
Hi,thanks for the quick response
Am using windows forms no ASP.NET.
to load the current row selected in the datagridview
int CustomerID = int.Parse(dataGridView1[dataGridView1.CurrentCellAddress.Y, 0].ToString());
customer customer = customerManager.GetCustomer(customerID);
then i fill the respective textboxes with data from that cell
txtcustomerID.Text = customer.CustomerID.ToString();
txtname.Text = customer.CompanyName;
the GetCustomer() method's definition is
public static customer GetCustomer(System.Int32 CustomerID)
{
string ConnectionString = "Server = (local);Integrated Security = SSPI ;Initial Catalog = pos";
string query = "Select * from CompanyProfile where CustomerId " + CustomerID;
DataTable dt = DataManager.ExecuteQuery(ConnectionString, query, "customer");
if (dt.Rows.Count == 0)
{
return null;
}
return new customer(dt.Rows[0]);
}
But when i run the Program and click in one of the cells,I get an error saying Input string is not in the correct format.
and the customerID value is 0 in that case though the value in the Database is 1.
The nature of your experience depends on your point of view.
|
|
|
|
|
What i want to do is,Get the value of the first cell with index 0 of the column CustomerID and use it in the query
which is "select * from companyprofile where customerID " +CustomerID;
-- modified at 4:58 Monday 2nd July, 2007
-- modified at 5:01 Monday 2nd July, 2007
The nature of your experience depends on your point of view.
|
|
|
|
|
I am getting a bunch of values via serial at baud 115200, now the values are like 5000 bytes at one paste on the hyperterminal. I am usign string to take it in. using the break point set on the input, it works fine, but whenI remove the break point it give a range our of bounds error....the following is the code. Help
string mine = "";
mine += sp.ReadExisting();
sp is the serial port.
Thanks
|
|
|
|
|
how do I call a delay of maybe 1 second with C#, is there any library to do this?
|
|
|
|
|
Hello,
You could work with timers. (System.Windows.Forms.Timer)
Or use Thread.Sleep(1000)
All the best,
Martin
|
|
|
|
|
|
Hi,
How can you find the process that called a particular function?
I've set a breakpoint on a function that gets called twice but should only be called once. I don't really want to step through the whole program so how do I know what executed immediately prior to the breakpoint?
Glen Harvy
|
|
|
|
|
Glen Harvy wrote: how do I know what executed immediately prior to the breakpoint?
That's what the Call Stack window in VS is there for. Place a breakpoint in your method and then bring up the Call Stack window (you will find it in the lower right of the VS window when you're debugging) - it will show you everything from Main().
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
For 18 months I've never used it - thanks
Learn something new *every* day.
Glen Harvy
|
|
|
|
|
Strg+Alt+C activates what have been suggested before!
All the best,
Martin
|
|
|
|
|
Martin# wrote: Strg
Is that German for Ctrl?
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Ah, never mind. Apparently, Strg stands for Steuerung, which is German for Control.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
|
I guess the function is called once in the event and also in the page load....
I was born dumb!!
 Programming made me laugh  !!!
--sid--
|
|
|
|
|
Hai Everybody,
Have a good day and great month
I have created an sample application in that, I kept a remotable object, I am having listener and client which are all windows services.
I have included the remotable object's reference in both clien and host application.
When i tried to build it has been done successfully.
but when i tried to compile the Server_Service class it is showing warnings like are you missing the assembly for all the namespaces that i have included in the service class even though for the System namespace also it is showing this error.
Can anyone give me a solution to solve this, Please....
You will give me the solution so
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
M. J. Jaya Chitra wrote: i tried to compile the Server_Service class it is showing warnings like are you missing the assembly for all the namespaces that i have included in the service class even though for the System namespace also it is showing this error.
Did you check the Namespace is available in the Assembly.
Regards,
Satips.
|
|
|
|
|
 I have all the references in the project. And all the three projects( Remotable object, Server_Service and Client_Service) are all in the same solution.
Sorry Only for the ComponentModel, Data, ServiceProcess Channels only it is showing errors not for other namespeces.
This is the error I am getting when i try to compile
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
d:\Chitra\Sample\Remoting_NET\Server_Service\Server_Service.cs(3,14): error CS0234: The type or namespace name 'ComponentModel' does not exist in the namespace 'System' (are you missing an assembly reference?)
d:\Chitra\Sample\Remoting_NET\Server_Service\Server_Service.cs(4,14): error CS0234: The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)
d:\Chitra\Sample\Remoting_NET\Server_Service\Server_Service.cs(6,14): error CS0234: The type or namespace name 'ServiceProcess' does not exist in the namespace 'System' (are you missing an assembly reference?)
d:\Chitra\Sample\Remoting_NET\Server_Service\Server_Service.cs(10,40): error CS0234: The type or namespace name 'Tcp' does not exist in the namespace 'System.Runtime.Remoting.Channels' (are you missing an assembly reference?)
d:\Chitra\Sample\Remoting_NET\Server_Service\Server_Service.cs(15,43): error CS0246: The type or namespace name 'ServiceBase' could not be found (are you missing a using directive or an assembly reference?)
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
M. J. Jaya Chitra wrote: error CS0234:
It says it is a Compiler Error.
The type or namespace name 'name' does not exist in the class or namespace 'scope' (are you missing an assembly reference?)
For More Detials:
MSDN[^]
Regards,
Satips.
|
|
|
|
|
is there anyway to do a memory allocation on a string type?
like
String Mine = allocate(65535); ????
Thanks
|
|
|
|
|
mercenary01 wrote: is there anyway to do a memory allocation on a string type?
Are you trying to reserve space for a string, a la C/C++? You don't need to do that in C# as the string is a first class citizen in .NET. Just say string s = null; and then you can assign any value you want, like s = "I love Bob";
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
I would have expected an "I love Vikram" example!

|
|
|
|
|
No there is not, but if you need to do complex work on a long string, you
should allocate a StringBuilder object with sufficient Capacity, work on it,
and when its done convert it to a string with ToString().
|
|
|
|
|
Hi,
I am writting shell extension in C#. For me it is becomming difficult to debug the Shell Extensions.
I am following the below step which I gathered from different groups / websites.
In "Project Properties" page
Debugging : Debug Mode -> Program
Start Application -> c:\WINDOWS\Explorer.exe
command line Arguments -> C:\
and I kept some break point in the source and pressed F5.
When press F5 It is Creating new Instance of "Windows Explorer", but it is not stopping at Break point.
I tried of attaching to the Windows Explorer using "Attach Process".
Still I am unable to debug the project.
Please, give me the step to Debug the Shell extesions.
Thanks
Ramesh
|
|
|
|
|
Hey all,
Can anyone tell me the best way to add keys to the registry?
At the moment i've exported the key's to my working directory, and am using the System.Diagnostics.Process.Start("Keyname") to update it.
It works, but it prompts the user with a message box to confirm if they want to do the update.
Can I stop the messagebox's popping up so my install goes smoothly, or do I have to do it some other way?
Thanks in advance,
Mark.
|
|
|
|
|
Do a google search for "C# registry"
|
|
|
|