update& retrieve images from sql server using vb.net

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2007
Posts: 82
Reputation: preetham.saroja is an unknown quantity at this point 
Solved Threads: 1
preetham.saroja's Avatar
preetham.saroja preetham.saroja is offline Offline
Junior Poster in Training

update& retrieve images from sql server using vb.net

 
0
  #1
Aug 6th, 2007
can anyone,plz
send m the code for retreiving & updating images onto the sql-server using vb.net...ASAP...
regards,
preetham......
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 812
Reputation: arjunsasidharan is on a distinguished road 
Solved Threads: 13
arjunsasidharan's Avatar
arjunsasidharan arjunsasidharan is offline Offline
Practically a Posting Shark

Re: update& retrieve images from sql server using vb.net

 
0
  #2
Aug 7th, 2007
Check this thread

Next time try searching the forum's before posting your queries.
There is just two ways to live your life.
One is as though nothing is a miracle.
The other is as if everything is.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 82
Reputation: preetham.saroja is an unknown quantity at this point 
Solved Threads: 1
preetham.saroja's Avatar
preetham.saroja preetham.saroja is offline Offline
Junior Poster in Training

Re: update& retrieve images from sql server using vb.net

 
0
  #3
Aug 7th, 2007
Originally Posted by arjunsasidharan View Post
Check this thread

Next time try searching the forum's before posting your queries.
--------------
hello boss,Only after rigrously searching for long time-i posted on this forum...
hello boss,first try to answer the queries(don't copy&paste 4m some others post)...
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 812
Reputation: arjunsasidharan is on a distinguished road 
Solved Threads: 13
arjunsasidharan's Avatar
arjunsasidharan arjunsasidharan is offline Offline
Practically a Posting Shark

Re: update& retrieve images from sql server using vb.net

 
0
  #4
Aug 7th, 2007
Hello boss, did you check the link?

hello boss, i wasn't copying and pasting the code.(). I am just guiding you to the thread which already existed. looks like you haven't even taken a bit of an effort to search it in this forum.
There is just two ways to live your life.
One is as though nothing is a miracle.
The other is as if everything is.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: update& retrieve images from sql server using vb.net

 
0
  #5
Aug 7th, 2007
Hi,

u can also check this

Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 82
Reputation: preetham.saroja is an unknown quantity at this point 
Solved Threads: 1
preetham.saroja's Avatar
preetham.saroja preetham.saroja is offline Offline
Junior Poster in Training

Re: update& retrieve images from sql server using vb.net

 
-1
  #6
Aug 7th, 2007
hai veena,

I tried even that also-it gives an error& now im trying this stuff-but gives an error called-"unauthorisedAccess Exception was unhandled by user code"
----------------
And below is m code for button1_click(to save image )


PrivateSub Button1_Click(ByVal sender AsObject, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As String = ConfigurationSettings.AppSettings("preeconn1")
Dim str As String = "select * from table2"
Dim da As New SqlDataAdapter(str, con)
Dim cmd As New SqlCommand(str, New SqlConnection(con))
Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
Dim ds As New DataSet()
da.MissingSchemaAction = MissingSchemaAction.AddWithKey
cmd.Connection.Open()
da.Fill(ds, "table2")
Dim fs As New FileStream("c:/pic/imgad[2].jpg", FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite)
Dim MyData(fs.Length) As Byte
fs.Read(MyData, 0, fs.Length)
fs.Close()
ds.Tables("table2").Rows(0)("logo") = MyData
da.Update(ds, "table2")
fs = Nothing
MyCB = Nothing
ds = Nothing
da = Nothing
cmd.Connection.Close()
con = Nothing
Response.Write("File saved to database")
End Sub
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 812
Reputation: arjunsasidharan is on a distinguished road 
Solved Threads: 13
arjunsasidharan's Avatar
arjunsasidharan arjunsasidharan is offline Offline
Practically a Posting Shark

Re: update& retrieve images from sql server using vb.net

 
0
  #7
Aug 8th, 2007
Do you want it in Asp.net or Windows application?

Check the link that i posted and check the last post. I have attached a sample application. All you have to do is change the connection string to the Sql Server and it should work.
Last edited by arjunsasidharan; Aug 8th, 2007 at 12:39 am.
There is just two ways to live your life.
One is as though nothing is a miracle.
The other is as if everything is.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC