Private Sub getData(ByVal user As String)
Dim CondStr As String = ""
Dim dt As New DataTable()
Dim connStr As String = ConfigurationManager.ConnectionStrings("testConnectionString").ConnectionString.ToString()
Dim conn As New SqlConnection(connStr)
conn.Open()
Dim sqlCmd As New SqlCommand("SELECT * from TABLE WHERE Table_Registration = @usersID", conn)
Dim sqlDa As New SqlDataAdapter(sqlCmd)
sqlCmd.Parameters.AddWithValue("@usersID", user)
sqlDa.Fill(dt)
If dt.Rows.Count > 0 Then
txt_B_Name.Text = dt.Rows(0)("B_Name").ToString()
txt_B_numberTeL.Text = dt.Rows(0)("B_numberTeL").ToString()
End If
conn.Close()
End Sub
Tag : .NET, Ms SQL Server 2005, Web (ASP.NET), VB.NET