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
Explain the various types of classes used in c#?
What is wpf c#?
Where is the main method in c#?
How do I format in c#?
What is variable in c#?
What is the base class from which all value types are derived?
Is c# different than c++?
What is the difference between int16 and int32 in c#?
Describe an abstract class?
What is the namespace for datatable in c#?
What is CLR and its application.?
What is use of list in c#?
Is array value type in c#?
What is type checking in c#?
if we are updating a database using thread, and mean while application crashes or thread being aborted then what will happen in Database? Rollback or Database will be updated? Please explain with different scenario.