sql code to extact records in database

Jopito
Posted by Jopito under ASP.NET category on | Points: 40 | Views : 728
check this sample


Dim conn As New SqlConnection("Data Source=3-THINK\SQLEXPRESS;Initial Catalog=Student Details;Integrated Security=True ")
conn.Open()
Dim com As New SqlCommand("Select* from Register", conn)
Dim reader As SqlDataReader = com.ExecuteReader
While reader.Read
Response.Write(reader.Item("Firstname"))
Response.Write("<br/b>")
End While
reader.Close()
conn.Close()

Comments or Responses

Login to post response