white these code to page_load so Radio Button List will be generated
Dim strConnection As String = “data source=(local);initial catalog=testDB; user id=sa; password=1234;”
Dim strSQLforListBox As String = “SELECT distinct FirstName, ID “
strSQLforListBox += “FROM Users”
Dim objConnection As New SqlConnection(strConnection)
Dim objCommand As New SqlCommand(strSQLforListBox, objConnection)
objConnection.Open()
radEmployees.DataSource = objCommand.ExecuteReader()
radEmployees.DataTextField = “FirstName”
radEmployees.DataValueField = “ID”
radEmployees.DataBind()
objConnection.Close()
Then we need to write the following codes in SelectedIndexChanged
Dim strConnection As String = “data source=(local);initial catalog=testDB; user id=sa; password=1234;”
Dim strSQLforGrid As String = “SELECT “
strSQLforGrid += ” FirstName, LastName, “
strSQLforGrid += “phone, PermanentAddress1 “
strSQLforGrid += “FROM Users “
strSQLforGrid += “WHERE ID= ” & radEmployees.SelectedItem.Value
Dim objConnection As New SqlConnection(strConnection)
Dim objCommand As New SqlCommand(strSQLforGrid, objConnection)
objConnection.Open()
DataGrid1.DataSource = objCommand.ExecuteReader()
DataGrid1.DataBind()
objConnection.Close()

