DataRow inaccessible...
-
Hello, I am writing a windows form app using c#. I would like to create a new data row in a regular c# class using the following code. public void addWell() { DataRow row = new DataRow(); } But I keep getting this error: "'System.Data.DataRow.DataRow(System.Data.DataRowBuilder)' is inaccessible due to its protection level" Does anybody know how to change the protection level of the DataRow? thanks! rc
-
Hello, I am writing a windows form app using c#. I would like to create a new data row in a regular c# class using the following code. public void addWell() { DataRow row = new DataRow(); } But I keep getting this error: "'System.Data.DataRow.DataRow(System.Data.DataRowBuilder)' is inaccessible due to its protection level" Does anybody know how to change the protection level of the DataRow? thanks! rc
You can't instatiate a new DataRow object like that, it's constructor is protected and you can't do anything about that. If you want a new DataRow you must use your DataTable.NewRow() method which will return a new row that has been initalized with your tables schema (i.e. all the columns have been added).
-
You can't instatiate a new DataRow object like that, it's constructor is protected and you can't do anything about that. If you want a new DataRow you must use your DataTable.NewRow() method which will return a new row that has been initalized with your tables schema (i.e. all the columns have been added).
-
Hello, I am writing a windows form app using c#. I would like to create a new data row in a regular c# class using the following code. public void addWell() { DataRow row = new DataRow(); } But I keep getting this error: "'System.Data.DataRow.DataRow(System.Data.DataRowBuilder)' is inaccessible due to its protection level" Does anybody know how to change the protection level of the DataRow? thanks! rc
The solution of this problem is to use : DataTable dt = new DataTable(); DataRow dr = dt.NewRow();
-
The solution of this problem is to use : DataTable dt = new DataTable(); DataRow dr = dt.NewRow();
Good Lord!
-
You can't instatiate a new DataRow object like that, it's constructor is protected and you can't do anything about that. If you want a new DataRow you must use your DataTable.NewRow() method which will return a new row that has been initalized with your tables schema (i.e. all the columns have been added).
i am using it in the webpage is that ok can you please suggest me as soon as possible