Can anyone show me an example of how to connect to SQL server and retrieve a recordset for my asp.net page?
Cheers.
Printable View
Can anyone show me an example of how to connect to SQL server and retrieve a recordset for my asp.net page?
Cheers.
Dim strConn as string
Dim strSql as string
strConn = "connection string"
strSql = "Sql statement"
Dim Conn as new sqlClient.SqlConnection(strConn)
Dim adptExample as new sqlClient.dataAdapter(strSql,strConn)
Dim ds as new dataset
adptExample.fill(ds)
this will give you your dataset which you then can bind to a control or if you want to can access through code.