Can't call Stored Proc... How to trace Flow of Web Application in VB.NET?

Discussion in 'ASP .Net' started by Mo, Dec 19, 2003.

  1. Mo

    Mo Guest

    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
     
    Mo, Dec 19, 2003
    #1
    1. Advertising

  2. 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
    >
    >
     
    Cowboy \(Gregory A. Beamer\), Dec 19, 2003
    #2
    1. Advertising

  3. You should use some breakpoints to debug it


    "Mo" <> escreveu na mensagem
    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
    >
    >
     
    Thiago Temple, Dec 19, 2003
    #3
  4. Mo

    Mo Guest

    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
    > >
    > >

    >
    >
     
    Mo, Dec 19, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hansiman
    Replies:
    0
    Views:
    499
    hansiman
    Feb 5, 2005
  2. David Lozzi
    Replies:
    3
    Views:
    1,944
    David Lozzi
    Jun 1, 2005
  3. Jack Dowson
    Replies:
    0
    Views:
    459
    Jack Dowson
    May 7, 2007
  4. Cindy Lee
    Replies:
    4
    Views:
    1,365
    Mr. Arnold
    Jul 30, 2010
  5. Dennis
    Replies:
    2
    Views:
    123
    dlbjr
    May 26, 2004
Loading...

Share This Page