Click to See Complete Forum and Search --> : How do I add a primary key in a dataset


torrud
September 20th, 2004, 04:44 PM
Hi,

I develope my C#-project with the Visual Studio 2003. How do I add a primary key by using the designer? At the moment I create a new dataset and import a few tables from the server explorer. So I get datatables from my SQL-Server by drag and drop. These datatables containing already a key. The same key like in the original database. I want this key, but for instance I use the find() - method for searching a DataRow I get an error. The error means I don't have a primary key in my datatable.
Why not? I see the key an it seems to be ok, but it isn't so.

Can anyone give me a hint? How do I add a primary key in the designer mode?

Thanks in advance