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 std :: string null terminated?
What is string empty?
How to use delegates with events?
What is namespace in oops?
What is 8 bit signed integer?
What is the difference between virtual and override in c#?
Explain dataadapter.update method in .net?
What is a linq in c#?
Describe an abstract class?
Is it possible to have different access modifiers on the get/set methods of a property in c#?
Describe ado.net?
What is difference between comparable and comparator?
What are the fundamental oop concepts?
What is parameterized constructor?
What is string class in c#?