Hi, I am having a problem updating my database when the user changes a boolean value in my datagrid. Basically i load a dataset into my datagrid from here the user can click on the yes/no box to say they have read it. The user then clicks an update button with the following code which i got from another article:
I am having a few problems understanding this code and how to apply it to mine. Could some possibly give me some guidance with this.
Thanks very much
John
VB.NET:
[SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] UpdateDatabase()
conn.Open()
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDbCommand
cmd.CommandText = "UPDATE DatabaseTable SET Resolve_Flag = "No", columnname = Resolve_Flag";
cmd.Connection = conn
cmd.parameters.add("@columnname1", oledbtype.Boolean, fieldsize,source column name [/SIZE][SIZE=2][COLOR=#0000ff]as[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2])
conn.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE]
I am having a few problems understanding this code and how to apply it to mine. Could some possibly give me some guidance with this.
Thanks very much
John