A
Asergea
Hey all,
Please help I'm very new and want to learn,
I have a SQL Database with three columns, "ID" (Primary Key), "FName"
and "LName"
All I want to do to learn, is to type the ID Number in Textbox1, Click
"Submit" and the FName apprears in
Textbox2 and Lname Appears in Textbox3.
I'm Doing this in Visual Basic..
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim Con1 As New SqlDataSource()
Con1.ConnectionString =
ConfigurationManager.ConnectionStrings("Test").ToString()
Con1.SelectCommandType = SqlDataSourceCommandType.Text
Con1.SelectCommand = "SELECT FName , LName FROM Agent WHERE ID
= 1 VALUES (@Textbox1, @Textbox2, @Textbox3)"
Con1.SelectParameters.Add("ID", Textbox1.Text)
Con1.SelectParameters.Add("FName", Textbox2.Text)
Con1.SelectParameters.Add("LName", Textbox3.Text)
End Sub = ((((((IT DOESNT" DISPLAY ANYTHING!!))))))
Please help I'm very new and want to learn,
I have a SQL Database with three columns, "ID" (Primary Key), "FName"
and "LName"
All I want to do to learn, is to type the ID Number in Textbox1, Click
"Submit" and the FName apprears in
Textbox2 and Lname Appears in Textbox3.
I'm Doing this in Visual Basic..
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim Con1 As New SqlDataSource()
Con1.ConnectionString =
ConfigurationManager.ConnectionStrings("Test").ToString()
Con1.SelectCommandType = SqlDataSourceCommandType.Text
Con1.SelectCommand = "SELECT FName , LName FROM Agent WHERE ID
= 1 VALUES (@Textbox1, @Textbox2, @Textbox3)"
Con1.SelectParameters.Add("ID", Textbox1.Text)
Con1.SelectParameters.Add("FName", Textbox2.Text)
Con1.SelectParameters.Add("LName", Textbox3.Text)
End Sub = ((((((IT DOESNT" DISPLAY ANYTHING!!))))))