update data row

G

gigi

i want to update one of data.
i have use this method to save my data.

'Decleare the file stream as fs
Dim fs As FileStream = New FileStream(filename, _
FileMode.OpenOrCreate, FileAccess.Read)
Dim rawData() As Byte = New Byte(fs.Length) {}
fs.Read(rawData, 0, System.Convert.ToInt32
(fs.Length))
fs.Close()

OleDbDataAdapter1.Fill(DataSet1, "ImageTest")
Dim myRow As DataRow
'Make new row
myRow = DataSet1.Tables("ImageTest").NewRow()
'Insert new data to table imageFile
myRow("ImageNo") = txtImageNo.text
myRow("ImageFile") = rawData

DataSet1.Tables("ImageTest").Rows.Add(myRow)
OleDbDataAdapter1.Update(DataSet1, "ImageTest")

MsgBox("Image saved to database")
 
G

Gigi

Hi there,
The code that you show I did not see any update code?
Can u show me how you update record from database?
The code that I post is used to save the database not to
update. Currently I only can save data to database.

Thanks
 
C

Cor Ligthert

Gigi,

Now I see it, when you have a simple select and there is not a lot of
strange things, than you can use just this

dim cmb as new OleDBCommandBuilder(OleDBDataAdapter1)
OleDbDataAdapter1.Update(DataSet1, "ImageTest")

It is said that it is buggy so test it well.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top