Data table in C#
-
Hi I have problem with data table in C#.In the code below i have data table which contains some values. "dt" is DataTable object and "dr" is DataRow[] object. when i fire some query on datatable using select method, it returns some datarows which fulfill the expression. And when i modify any column value of datarow like column "ID" it also modifies the values in datatable dt. Can you tell me why this is happening? I don't want to modify values in datatable dt. Thank you. Class prog { static void Main(string[] args) { dr = dt.Select(expression); dr[0]["ID"] = 10; } }
-
Hi I have problem with data table in C#.In the code below i have data table which contains some values. "dt" is DataTable object and "dr" is DataRow[] object. when i fire some query on datatable using select method, it returns some datarows which fulfill the expression. And when i modify any column value of datarow like column "ID" it also modifies the values in datatable dt. Can you tell me why this is happening? I don't want to modify values in datatable dt. Thank you. Class prog { static void Main(string[] args) { dr = dt.Select(expression); dr[0]["ID"] = 10; } }
-
dalbhide bipin, The datarow references the datatable, so they are "one". Why are you trying to only edit the datarow and not the table? eg: What are you doing? Regards, Gareth.
thanks.. i got it...