943,771 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 15627
  • VB.NET RSS
Aug 6th, 2007
0

update& retrieve images from sql server using vb.net

Expand Post »
can anyone,plz
send m the code for retreiving & updating images onto the sql-server using vb.net...ASAP...
regards,
preetham......
Similar Threads
Reputation Points: 5
Solved Threads: 1
Junior Poster in Training
preetham.saroja is offline Offline
82 posts
since Jun 2007
Aug 7th, 2007
0

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

Check this thread

Next time try searching the forum's before posting your queries.
Reputation Points: 347
Solved Threads: 13
Practically a Posting Shark
arjunsasidharan is offline Offline
812 posts
since Aug 2006
Aug 7th, 2007
-1

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

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)...
Reputation Points: 5
Solved Threads: 1
Junior Poster in Training
preetham.saroja is offline Offline
82 posts
since Jun 2007
Aug 7th, 2007
0

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

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.
Reputation Points: 347
Solved Threads: 13
Practically a Posting Shark
arjunsasidharan is offline Offline
812 posts
since Aug 2006
Aug 7th, 2007
0

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

Hi,

u can also check this

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Aug 7th, 2007
-1

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

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
Reputation Points: 5
Solved Threads: 1
Junior Poster in Training
preetham.saroja is offline Offline
82 posts
since Jun 2007
Aug 8th, 2007
0

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

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.
Reputation Points: 347
Solved Threads: 13
Practically a Posting Shark
arjunsasidharan is offline Offline
812 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Visual Studio Standard or Proffesional
Next Thread in VB.NET Forum Timeline: Datagrid view using parameters(Plz help)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC