Get 1st record in ADO.Net
- From: "sam" <samuellai@xxxxxxxxxxxx>
- Date: Mon, 6 Jun 2005 11:53:41 +0800
I not familiar at ASP.Net 1.1 because I were ASP 3.0 programmer.
I just wanna get 1st record in data but I don't know to code at ASP.Net 1.1
ASP 3.0
-------
Set rsFILE = Server.CreateObject("ADODB.Recordset")
rsFILEstatm = "SELECT * FROM F4111 ORDER BY ILUKID DESC"
rsFILE.Open rsFILEstatm, ConnAS400
rsFILE.movefirst
lastnum = CDbl(rsFILE("ILUKID"))
rsFILE.close
Set rsFILE = Nothing
Set rsFILEstatm = Nothing
Asp.Net 1.1
-----------
Dim constrDBL As String = "server='SQLSVR'; Database='JDE_ERP'"
Dim sqlconDBL As System.Data.SqlClient.SqlConnection = New
System.Data.SqlClient.SqlConnection(constrDBL)
Dim sqlcmdDBL As System.Data.SqlClient.SqlCommand = New
System.Data.SqlClient.SqlCommand("SELECT * FROM F4111 ORDER BY ILUKID DESC",
sqlconDBL)
Try
sqlconDBL.Open
Dim dbrDBL As System.Data.SqlClient.SqlDataReader =
sqlcmdDBL.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
Do While dbrDateFr.Read
' How to write get first record then exit
Loop
sqlcmdDBL = Nothing
dbrDBL = Nothing
Finally
sqlconDBL.Close
sqlconDBL.Dispose()
End Try
constrDBL = Nothing
sqlconDBL = Nothing
Please guide me.
Many thanks.
.
- Follow-Ups:
- RE: Get 1st record in ADO.Net
- From: Gonzalo Medina
- Re: Get 1st record in ADO.Net
- From: Cor Ligthert
- Re: Get 1st record in ADO.Net
- From: A.J
- RE: Get 1st record in ADO.Net
- Prev by Date: connection options to yukon
- Next by Date: I dragged an SQL table onto a form, it works, but where is the Open() method being called?
- Previous by thread: connection options to yukon
- Next by thread: Re: Get 1st record in ADO.Net
- Index(es):
Relevant Pages
|