Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Dealing with Data Type Image

Author  Topic 

Starting Member

1 Post

Posted - 2007-04-20 : 11:25:53
Hi everyone,

Apology if this question doesn't belong to here.

I've created a table in SQL database with a field of type image, I also have a imge box on the web form where the user can browse for the file. So I need help in completing the code to replace the question marks.
Protected Sub cmdSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click

Dim eSurveyAdd As New SqlDataSource()

eSurveyAdd.ConnectionString = ConfigurationManager.ConnectionStrings("CITSSurveyConnectionString1").ToString
eSurveyAdd.InsertCommandType = SqlDataSourceCommandType.Text
eSurveyAdd.InsertCommand = "INSERT INTO SurveyEntry (IT_LastName, IT_FirstName, PR_SnapShot, PR_Comments)
VALUES (@IT_LastName, @IT_FirstName, @PR_SnapShot, @PR_Comments)"

eSurveyAdd.InsertParameters.Add("IT_LastName", txtLastName.Text.ToUpper())
eSurveyAdd.InsertParameters.Add("IT_FirstName", txtFirstName.Text)
eSurveyAdd.InsertParameters.Add("PR_SnapShot", imgSnapShot.???????)
eSurveyAdd.InsertParameters.Add("PR_Comments", txtGeneralComments.Text)

Dim eProblemOccurred As Integer

eProblemOccurred = eSurveyAdd.Insert()
If eProblemOccurred <> 1 Then
End If
End Sub
(I'm still very new to SQL & Web developer).
Many thanks in advance.

Try your best, not enough ??, not your fault, just dive in desert.!!

- Advertisement -