Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make SqlCommandBuilder respect Primary Key ?
Message
From
19/09/2007 22:33:36
Handi Rusli
PT. Alam Sumbervita
Jakarta, Indonesia
 
 
To
19/09/2007 01:50:34
Handi Rusli
PT. Alam Sumbervita
Jakarta, Indonesia
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01255359
Message ID:
01255661
Views:
13
Hello ? Anybody home ?

Is my problem too difficult to be solved ? or should I setting up these manually ?

Any link and comments are appreciated. Thanks in advance :-)


>Hi all,
>
>I have a Customer Table with these following fields :
>
>CustID ---> Char(10) ---> Primary Key
>CustName ---> Char(30)
>
>and these are my listing :
>
>DataSet DS = new DataSet();
>SqlDataAdapter DA = new SqlDataAdapter("Select * from customer");
>DA.MissingSchemaAction = MissingSchemaAction.AddWithKey;
>SqlCommandBuilder SQLBuilder = new SqlCommandBuilder(DA);
>DA.Fill(DS, "customer");
>DA.InsertCommand = SQLBuilder.GetInsertCommand();
>DA.UpdateCommand = SQLBuilder.GetUpdateCommand();
>DA.DeleteCommand = SQLBuilder.GetDeleteCommand();
>
>System.Console.WriteLine(DA.UpdateCommand.CommandText);
>System.Console.ReadLine();
>
>the result is :
>UPDATE [customer] SET CustID=@p1, CustName=@p2 WHERE CustID=@p3 AND CustName=@p4
>
>The question is :
>
>How to make WHERE's Clause just only using Primary Key ?
>
>( I know that we can setting up manually, but that's not what I looking for )
>
>Thanks in advance :-D
Handi Rusli
"Treat people with respect and courtesy, and one will be blessed. Complete task heartily, with best effort and responsibility, and one can achieve the greatest."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform