views:

58

answers:

2

Hi, I have a AdvWebGrid where the 7th coloumn is DynEdit where user will enter the value.Now I have to take the enetered value and insert into the Sql tablel. For example i have 7 records in the grid the user will enter some comments for the first three record and save.Now i have to insert/update the first three comments in the table.

A: 

You'd probably want to let the user edit the grid records one at a time with an edit column. Here's some more info:

http://www.google.com/search?q=edit+gridview

IrishChieftain
A: 

If you are able to get the info in the 7th column you could use a datable with the rows you need, the use a sqldataadapter to fill the info into the sql server, i feel this is the best way to do it.

Other way is create a storeprocedure at your sqlserver then invoque it from your .net program using sqlcommand and sqldatareader...

Here is an example.

Dim val as integer = value you want to insert
Dim comi As New SqlCommand
Dim dr As SqlDataReader
Dim _con as sqlconnection 

_con.ConnectionString = _strcon ' connection string

    comi.CommandType = CommandType.StoredProcedure
    comi.CommandText = sp_name  ' your store procedur is sp_name this inserts a value into the table x
    comi.Connection = _con 
    comi.Parameters.AddWithValue("val",val)
    dr = comi.ExecuteReader
    dr.Close()

This should do the trick ...

Greetings !

carlos