SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

Serious_Dilemma
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
Server.Transfer("FailedSave.aspx")
Else
Server.Transfer("SuccessfullSave.aspx")
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  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000