I am new to ASP.NET and I have been using ASP for some time now. My old statements of connecting to a database do not work anymore. below is what I tried to use but it said set is no longer supported. How would you put this statement now to connect to a SQL database using ASP.NET???
Public Sub Page_Load(Source as Object, E As EventArgs)
if Not Page.IsPostBack Then
Dim dbconn
Dim dbrs
Dim AccessLevel
set dbconn = server.createobject("ADODB.Connection"
dbconn.Open "Provider=SQLOLEDB;Data Source=AM1ST_FS1;" _
& "Initial Catalog=HRINFO;User Id=sa;" _
& "Connect Timeout=15;"
set dbrs = server.createobject("ADODB.Recordset"
dbrs.open ("Select * from employeeinfo where userID = '" & request.servervariables("AUTH_USER" & "'", dbconn, 0, 1
If dbrs.EOF = True Then
dbrs.close
dbrs.open ("Select * from employeeinfo where userID = 'AM1ST_DOMAIN\" & request.servervariables("AUTH_USER" & "'", dbconn, 0, 1
End If
End If
End Sub
Public Sub Page_Load(Source as Object, E As EventArgs)
if Not Page.IsPostBack Then
Dim dbconn
Dim dbrs
Dim AccessLevel
set dbconn = server.createobject("ADODB.Connection"
dbconn.Open "Provider=SQLOLEDB;Data Source=AM1ST_FS1;" _
& "Initial Catalog=HRINFO;User Id=sa;" _
& "Connect Timeout=15;"
set dbrs = server.createobject("ADODB.Recordset"
dbrs.open ("Select * from employeeinfo where userID = '" & request.servervariables("AUTH_USER" & "'", dbconn, 0, 1
If dbrs.EOF = True Then
dbrs.close
dbrs.open ("Select * from employeeinfo where userID = 'AM1ST_DOMAIN\" & request.servervariables("AUTH_USER" & "'", dbconn, 0, 1
End If
End If
End Sub