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 |
What are the steps you will take to improve performance? Will you use dataset or datareader?
What is ole access?
Explain executenonquery?
what is Execute NOn Query?
29 Answers Infosys, Protech, Sars Systems, SwanSoft Technologies,
What is the difference between sqldatareader and sqldataadapter?
What do you know about ADO.NET's objects and methods?
What are the different methods available under the sqlcommand class to access the data?
What is Debug.write does?
Explain the namespaces in which .net has the data functionality class.
Which is faster datareader or dataadapter?
What is an orm, and why would you use one instead of plain old ado.net?
How can we serialize the dataset object?