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
How to implement delegates in c#.net
what is the difference between a struct and a class in c#?
What are boxing and unboxing?
Is array passed by reference in c#?
What are the main reasons to use c# language?
Why we use get set property in c#?
What is difference between array and arraylist c#?
Where’s global assembly cache located on the system?
What are the different types of classes in c#?
What is meaning of type safety in c#?
What is hashset c#?
Is stringbuilder thread safe c#?
Is array a list?
What is thread pooling?
Explain briefly the difference between value type and reference type?