J
Jean Christophe Avard
Hi! I have a dataset that retreive all the item information from the
database. I need to be able to edit them, in the dataset and in the
database.
I have this code, could anyone tell me if I'm in the good way, cause I build
that code from a book example, but nothing works.
I HAVE THIS CODE TO SAVE THE CHANGE OF THE DATASET
dstPlant.Tables("plant").Rows(intEditRow)("latin_name") = "KLHJJKJKJKHHHHHH"
dstPlant.GetChanges()
dadPlant.Update(dstPlant, "plant")
AND THIS IS THE CODE I USE TO DECLARE THE DATA SET AND DATA ADAPTER
dadPlant = New SqlDataAdapter(STR_SQL_PLANT_SELECT_ALL, cnnSignspro)
' instantiate the sql command
cmmUpdate = New SqlCommand("UPDATE tblItems SET latin_name=@latin_name WHERE
id_item=@id", cnnSignspro)
' instantiater the da update command
dadPlant.UpdateCommand = cmmUpdate
' add update parameter
cmmUpdate.Parameters.Add("@latin_name", SqlDbType.VarChar, 70, "latin_name")
prmUpdate = dadPlant.UpdateCommand.Parameters.Add("@id_item", SqlDbType.Int,
4, "id_item")
prmUpdate.Direction = ParameterDirection.Input
prmUpdate.SourceVersion = DataRowVersion.Original
' instantiate the data set
dstPlant = New DataSet("plant")
' fill the data set
dadPlant.Fill(dstPlant, "plant")
ANYONE!?!?!?
database. I need to be able to edit them, in the dataset and in the
database.
I have this code, could anyone tell me if I'm in the good way, cause I build
that code from a book example, but nothing works.
I HAVE THIS CODE TO SAVE THE CHANGE OF THE DATASET
dstPlant.Tables("plant").Rows(intEditRow)("latin_name") = "KLHJJKJKJKHHHHHH"
dstPlant.GetChanges()
dadPlant.Update(dstPlant, "plant")
AND THIS IS THE CODE I USE TO DECLARE THE DATA SET AND DATA ADAPTER
dadPlant = New SqlDataAdapter(STR_SQL_PLANT_SELECT_ALL, cnnSignspro)
' instantiate the sql command
cmmUpdate = New SqlCommand("UPDATE tblItems SET latin_name=@latin_name WHERE
id_item=@id", cnnSignspro)
' instantiater the da update command
dadPlant.UpdateCommand = cmmUpdate
' add update parameter
cmmUpdate.Parameters.Add("@latin_name", SqlDbType.VarChar, 70, "latin_name")
prmUpdate = dadPlant.UpdateCommand.Parameters.Add("@id_item", SqlDbType.Int,
4, "id_item")
prmUpdate.Direction = ParameterDirection.Input
prmUpdate.SourceVersion = DataRowVersion.Original
' instantiate the data set
dstPlant = New DataSet("plant")
' fill the data set
dadPlant.Fill(dstPlant, "plant")
ANYONE!?!?!?