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.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Dealing with Data Type Image
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 04/20/2007 :  11:25:53  Show Profile  Reply with Quote
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.!!
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000