sql server data types c

sql server data types c

Example C# code for Asp.net datagrid view with bound textbox fields and read into MS SQL DB?

I am programming a datagrid that pulls bound data from a DB based on the user selection. There are 5 columns no matter what.
The idea is to have an excel type input and the upon hitting the save changes button all the data gets feed into the database.
Everything works except the save button. I am currently running a loop where It runs for the number of rows in the grid, pulls the data from each field as a textbox, converts the data to the appropriate datatype and puts it into a dataset, but once I get that far I can't get the save function to work properly. So basically where I am at is I have a dataset, with information from the grid and I need to put it into a MS SQL server.

I am looking for a basic example of how my code should look from here.

1. Bind your DataGrid via a DataAdapter that fills the DataSet.

2. Make changes to your DataSet.

3. Use this code to update to SQL:

SqlCommandBuilder myBuilder = new SqlCommandBuilder( myDataAdapter );
myDataAdapter.Update( myDataSet, "TableName");

[phpbay]sql server data types c, 30, "11211"[/phpbay]
[phpzon]sql server data types c, 5, Electronics[/phpzon]

SQL Server 03 Data Types Properties

Leave a Reply