Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Serious_Dilemma
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 Server.Transfer("FailedSave.aspx") Else Server.Transfer("SuccessfullSave.aspx") End IfEnd 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.!! |
|
|
|
|
|
|