Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Access Method
Message
From
02/11/2007 00:12:12
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
VB 8.0
OS:
Vista
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01265411
Message ID:
01265976
Views:
8
Patrick,

As it turns out, I don't think setting the Primary Key on the DataSet's DataTable is absolutely necessary (I tried without and it worked fine) ... sorry about that ... as I said, I don't use the CommandBuilder at all and I also don't use PK's in my DataSet (database, yes, but not in the DataSet).

>Thanks, I am still getting this error: Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.

Your problem is one of two things ...

1) You are not returning the CO_ID in your Select statement.
2) Your database does not consider CO_ID to be a Primary Key.

~~Bonnie



>
>
>Here is the code I tried to let the da/cb know what the Key field is.
>
>Dim keys(1) As DataColumn
>keys(0) = ds.Tables(0).Columns("CO_ID")
>ds.Tables(0).PrimaryKey = keys
>
>
>>Patrick,
>>
>>Personally, I avoid the CommandBuilder and prefer to roll my own. But, first to answer your question:
>>
>>
>>MyDataSet.Tables[0].PrimaryKey = new DataColumn[] { MyDataSet.Tables[0].Columns["MyPK"] };
>>
>>
>>I've posted quite a number of times on this topic. You might want to take a look at the following posts:
>>
>>Message #1263419
>>Message #942418
>>Message #1151519
>>Message #1058327
>>
>>That might give you a few ideas.
>>
>>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform