Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: error message

  1. #1
    Regular Coder
    Join Date
    Feb 2004
    Location
    Malaysia
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts

    error message

    hi all,
    i am not sure wat this error means..would really appreciate it if someone cld help...really in need of help...thanks

    Parameterized Query '(@Lead_Name nvarchar(500),@Address nvarchar(1000),@Office_Phone ' expects parameter @Lead_Name, which was not supplied.
    wat does it mean?? and how to fix this?

    thanks
    Warm Regards,
    Mivec

  • #2
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,088
    Thanks
    2
    Thanked 23 Times in 23 Posts
    Sounds like you have a stored procedure that has some errors in it, or else you have a parameter for your stored procedure for which you haven't supplied a value. It would be helpful if you'd show us your code.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #3
    Regular Coder
    Join Date
    Feb 2004
    Location
    Malaysia
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by vinyl-junkie View Post
    Sounds like you have a stored procedure that has some errors in it, or else you have a parameter for your stored procedure for which you haven't supplied a value. It would be helpful if you'd show us your code.
    sure...the code is. i hv bolded the error where it occurs :

    Code:
    <script language="VB" runat="server">
    
          
        Dim objConnection As Data.SqlClient.SqlConnection
      
        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            objConnection = New Data.SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True")
            AddAccounts()
            Response.Redirect("SFA1ConvertSuccess110207.aspx?urlBack=SFA1ListLeads210107.aspx&name=Leads")
            
        End Sub
        
        Sub AddAccounts()
            Dim objCommand As Data.SqlClient.SqlCommand
            Dim strSQL As String
            
            strSQL = "INSERT INTO SFA1AccountsDetails " _
                    & "([Accounts Name], [Billing Address], [Office Phone], Mobile, Fax, [Company Name], Industry, [Annual Revenue]) " _
                    & "VALUES (@Lead_Name, @Address, @Office_Phone, @Mobile, @Fax, @Company, @Industry, @Annual_Revenue)"
            
            objCommand = New Data.SqlClient.SqlCommand(strSQL, objConnection)
        
            ' Add parameters that our SQL command takes:
            objCommand.Parameters.Add(New Data.SqlClient.SqlParameter("@Lead_Name", Data.SqlDbType.NVarChar, 500))
            objCommand.Parameters.Add(New Data.SqlClient.SqlParameter("@Address", Data.SqlDbType.NVarChar, 1000))
            objCommand.Parameters.Add(New Data.SqlClient.SqlParameter("@Office_Phone", Data.SqlDbType.NVarChar, 20))
            objCommand.Parameters.Add(New Data.SqlClient.SqlParameter("@Mobile", Data.SqlDbType.NVarChar, 20))
            objCommand.Parameters.Add(New Data.SqlClient.SqlParameter("@Fax", Data.SqlDbType.NVarChar, 20))
            objCommand.Parameters.Add(New Data.SqlClient.SqlParameter("@Company", Data.SqlDbType.NVarChar, 500))
            objCommand.Parameters.Add(New Data.SqlClient.SqlParameter("@Industry", Data.SqlDbType.NVarChar, 300))
            objCommand.Parameters.Add(New Data.SqlClient.SqlParameter("@Annual_Revenue", Data.SqlDbType.Money))
            
            Response.Write(CStr(Request.Form("DetailsView1.TextBox1")))
            
            objCommand.Parameters("@Lead_Name").Value = CStr(Request.Form("DetailsView1.Fields.TextBox1"))
            objCommand.Parameters("@Address").Value = CStr(Request.Form("DetailsView1.Fields.TextBox6"))
            objCommand.Parameters("@Office_Phone").Value = CStr(Request.Form("DetailsView1.Fields.TextBox7"))
            objCommand.Parameters("@Mobile").Value = CStr(Request.Form("DetailsView1.Fields.TextBox8"))
            objCommand.Parameters("@Fax").Value = CStr(Request.Form("DetailsView1.Fields.TextBox9"))
            objCommand.Parameters("@Company").Value = CStr(Request.Form("DetailsView1.Fields.TextBox3"))
            objCommand.Parameters("@Industry").Value = CStr(Request.Form("DetailsView1.Fields.TextBox4"))
            objCommand.Parameters("@Annual_Revenue").Value = CInt(Request.Form("DetailsView1.Fields.TextBox11"))
    
            objConnection.Open()
            objCommand.ExecuteNonQuery()
            objCommand.Cancel()
            objConnection.Close()
           
        End Sub
        
    </script>
    basically, wat i want to do is to get the values that are in the textbox(which are in the DetailsView) and insert into the db.
    Warm Regards,
    Mivec

  • #4
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    CStr(Request.Form("DetailsView1.Fields.TextBox1"))

    perhaps should be
    CStr(Request.Form("DetailsView1.Fields.TextBox1.Value"))

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #5
    Regular Coder
    Join Date
    Feb 2004
    Location
    Malaysia
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by nikkiH View Post
    CStr(Request.Form("DetailsView1.Fields.TextBox1"))

    perhaps should be
    CStr(Request.Form("DetailsView1.Fields.TextBox1.Value"))
    nope...it din work...i think u knw...there are no values there bcoz that code is in the same page of where the values has not gone to the server..thats y request.form does not work...maybe by refreshing the page again then i can use request.form again i guess....or i redirect it to another page and use the code there....

    cheers
    Warm Regards,
    Mivec

  • #6
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Does Response.Write(CStr(Request.Form("DetailsView1.TextBox1"))) return a value?

    If it is in the same page why wait for a postback to retrieve the values?

    Can you not simply access the textbox.value and not use request.form ?

    e.g.

    objCommand.Parameters("@Lead_Name").Value = TextBox1.Value

    or perhaps objCommand.Parameters("@Lead_Name").Value = DetailsView1.TextBox1.Value

    Designer Websites


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •