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
What is data dictionary in c#?
What is data set in c#?
List some of the common data providers for ado.net framework?
What happens if the inherited interfaces have conflicting method names?
What are mutable and immutable types in c#?
Explain the difference between passing parameters by value and passing parameters by reference with an example?
What Is A Satellite Assembly?
Perfect Example Of While And Do-While Loop In C#.Net ?
How can I create image pieces/sub image?
List down the differences between public, static and void keywords?
Can you declare a class or a struct as constant?
What is generic in c#?
HOW to Develope the CRUD(create,read,update,delete) FORM IN WINDOWS form by using c# only
Define the term immutable ?
Who is a accessibility modifier “protected internal†available to ?