Error: No data exists for the row/column

E

egsdar

Hello, I'm trying to retreive info from a query in order to add it to a query
but in the process it displays this error:

No data exists for the row/column.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.InvalidOperationException: No data exists for the
row/column.

Source Error:

Line 22: Dim StrReader As OleDbDataReader
Line 23: StrReader = objCmd.ExecuteReader()
Line 24: Response.Write("the value is " +
StrReader.Item("clave"))
Line 25: Response.End()
Line 26: 'Dim myCookie As HttpCookie = New
HttpCookie("UserSettings")

This is the full code:

<script runat="server">
Sub Page_Load(ByVal obj As Object, ByVal e As EventArgs)
If IsPostBack() Then
Dim objConn As New
OleDbConnection("Provider=SQLNCLI;Server=db2fx981\comware;Database=SIP;Trusted_Connection=yes;")
objConn.Open()
Dim sSQL, Resul As String
sSQL = "select * from usuario where usuario='" &
Request("pwdusr") & "' and clave='" & Request("pwdpwd") & "'"
'Response.Write(sSQL)
'Response.End()
'"Insert into Origen (Descripcion) values ('" & Descripcion.Text
& "')"
Dim objCmd As New OleDbCommand(sSQL, objConn)

Resul = objCmd.ExecuteNonQuery

If Resul Then
Dim StrReader As OleDbDataReader
StrReader = objCmd.ExecuteReader()
Response.Write("el valor es " + StrReader.Item("clave"))
Response.End()
'Dim myCookie As HttpCookie = New HttpCookie("UserSettings")
'myCookie("Font") = "Arial"
'myCookie("Color") = "Blue"
'myCookie.Expires = Now.AddDays(1)
'Response.Cookies.Add(myCookie)
'Response.Redirect("http://www.google.com")
'LblSaved.Visible = True
Else
Lblwrong.Visible = True
End If
End If
End Sub

</script>

How can i solve this?

Thx.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top