C# Code for How to set readonly property to Id(database)
value?
Answer Posted / karthikeyan
String connectionString = @"Data
Source=.\SQLExpress;Initial Catalog=Nwind;Integrated
Security=SSPI";
SqlConnection con = new SqlConnection(connectionString);
string conString = "Select * From Customers";
SqlDataAdapter dataAdpter = new SqlDataAdapter(conString,
con);
DataSet ds = new DataSet();
dataAdpter.Fill(ds);
ds.Tables[0].Columns[0].ReadOnly = true;
dataGridView1.DataSource = ds.Tables[0];
| Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
Is c# an open source language?
What are Memory foot print of an exe?
What is cshtml?
What is the root element of an xml file?
Define an assembly in .net?
what is generics? can u explain 5 to 6 examples on generics that covers class,method,structure,list,delegates?
Why should I use interface in c#?
What is lock in c#?
How are methods overloaded?
Why do we need reflection in c#?
What is multicast delegate explain with example?
What is void in c#?
Can we inherit partial class in c#?
What is the difference between string and string in c#?
What is difference between array and collection in c#?