How to add Primary key in DataSet
Answers were Sorted based on User's Feedback
Answer / kamalakannan.a
If we use c#
DataTable dt=new DataTable();
DataColumn Dc1 = new DataColumn("No", Type.GetType
("System.Int32"));
dt.Columns.Add(Dc1);
//Set Primary key
DataColumn[] dc = new DataColumn[1];
dc[0] = dt.Columns["No"];
dt.PrimaryKey = dc;
Kamal..
Is This Answer Correct ? | 34 Yes | 7 No |
Answer / gopi
ds.Tables[0].Constraints.Add("pk_sid",
ds.Tables[0].Columns[0], true);
Is This Answer Correct ? | 29 Yes | 4 No |
Answer / shahil singh
dim col() as new dt.datacolumn
col(0)=dt.column(1)
dt.primarykey=col
Is This Answer Correct ? | 30 Yes | 8 No |
Answer / r.prajapati
In eidt dataset designer right click on column name which u
want as primary key and set it as pk
Is This Answer Correct ? | 19 Yes | 14 No |
Answer / tamilan
This is answer is great. its help me lot.
In eidt dataset designer right click on column name which u
want as primary key and set it as pk
Is This Answer Correct ? | 6 Yes | 5 No |
i making a project using windows application c#, i want to show user name, password, and one button login. i wanna make it with sealed class .how its possible . when i clicked my login button all project should be open. pls cleare me.
What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?
If a dataset contains 100 rows, how to fetch rows between 10 and 20 only ?
Explain the role of data provider in ado.net?
Is ado.net an orm?
What are the different execute methods of Ado.Net?
Advantage of ADO.Net?
Define connection string?
Differences between dataset.clone and dataset.copy?
What are the advantages and drawbacks of using ado.net?
How to store data in memory?
What is ado.net object model?