Hi,
I tried the System.Diagnostics.Trace.WriteLine command to check my form
values before being sent to the stored procedure, but i don't see any
output still. The form just reloads. Here is my vb code for the
submit_click sub:
Private Sub Submit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles submit.Click
Dim objUpload As ASPUPLOADLib.IUploadManager
objUpload = New ASPUPLOADLib.UploadManager()
Dim objFile As ASPUPLOADLib.IUploadedFile
Dim File, item, ThisType, Size, ID
Dim datapath
If Len(Request.QueryString("fileID")) > 0 Then
ID = Request.QueryString("fileID")
Else
ID = 0
End If
If docType.SelectedItem.Value = "--- Select a Type ---" Then
ThisType = ""
Else
ThisType = docType.SelectedItem.Value
End If
If Request("edit") = "true" Then
Dim UpdateDocRoom As New DocRoomMain()
Dim IsSuccessful As Integer =
UpdateDocRoom.UpdateDocument(ID, Session("projectID"), docDate.Text,
toCompany.Text, toPerson.Text, fromCompany.Text, fromPerson.Text,
subject.Text, reference.Text, ThisType, keywords.Text, filePath.Text,
fileName.Text, docSize.Text)
If IsSuccessful < 1 Then
Response.Write("Update has been unsuccessful")
End If
Else
datapath = ConfigurationSettings.AppSettings("DataPath") &
Session("companyName") & "\" & projectName.Text & "\DocRoom"
objUpload.OverwriteFiles = False
Dim Count As Integer = objUpload.Save(datapath,
Missing.Value, Missing.Value)
If Count > 0 Then
Dim UpdateDocRoom As New DocRoomMain()
For Each objFile In objUpload.Files
File = objFile.ExtractFileName
Size = objFile.Size()
Next
'********** TRACING AREA ****************************
' Test All Form Values
System.Diagnostics.Trace.WriteLine("Company Name: " +
toCompany.Text)
' Call Stored Procedure
Dim IsSuccessful As Integer =
UpdateDocRoom.AddDocument(ID, Session("projectID"), docDate.Text,
toCompany.Text, toPerson.Text, fromCompany.Text, fromPerson.Text,
subject.Text, reference.Text, ThisType, keywords.Text, filePath.Text,
fileName.Text, docSize.Text)
'********** TRACING AREA ****************************
If IsSuccessful < 1 Then
Response.Write("File Not Uploaded. Failure at
Database level. Please Try Again.")
End If
End If
End If
End Sub
"Cowboy (Gregory A. Beamer)" <> wrote in
message news:...
> Either bind each time (not just in 'If Not Page.IsPostBack Then'), or make
> sure ViewState is turned on.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ************************************************** ********************
> Think Outside the Box!
> ************************************************** ********************
> "Mo" <> wrote in message
> news:%...
> > Hi,
> >
> >
> > I have a webform which has vb.net code behind it and I would like it to
> > submit the entries in the fields into a sql server db using a stored
> > procedure. I have a central .vb file in my application that has all the
> > stored proc calls in it. in the Submit_Click Sub in my form.vb file, I
> > reference the function in my central .vb file which calls the stored
proc.
> >
> > The problem that I am having is that when I submit my form, it just
> reloads
> > the form minus all the values. The form is set to run at server. I
would
> > like to trace my application to see if the form values are actually
being
> > sent to my store proc function. I am new to .NET and I would greatly
> > appreciate any help.
> >
> > Thank you kindly,
> >
> > Muhsin
> >
> >
>
>