By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

update data row

P: n/a
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")
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Gigi,

In your update and fills I see no errors, so have a look at my sample how to
get it in the dataset

http://groups-beta.google.com/group/...62bd537315d0ce

I hope this helps?

Cor
Nov 21 '05 #2

P: n/a
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
-----Original Message-----
Gigi,

In your update and fills I see no errors, so have a look at my sample how toget it in the dataset

http://groups- beta.google.com/group/microsoft.public.dotnet.languages.vb
/msg/b662bd537315d0ce
I hope this helps?

Cor
.

Nov 21 '05 #3

P: n/a
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
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.