data reader

Results 1 to 2 of 2

Thread: data reader

  1. #1
    Join Date
    Dec 1969

    Default data reader

    Hi all,<BR> I have the following code:<BR>...<BR>objDR = objCmd.ExecuteReader()<BR> If objDR.Item("page_name") = "testpage" Then<BR> Response.Redirect("sgsdg")<BR> End If<BR> dg1.DataSource = objDR<BR> dg1.DataBind()<BR> objDR.Close()<BR>...<BR>I keep getting :&#039;Invalid attempt to read when no data is present.&#039;<BR><BR>I&#039;m simply trying to say if the db field &#039;page_name&#039; has &#039;testpage&#039; then redirect user and not bind the grid.

  2. #2
    Join Date
    Dec 1969

    Default RE: data reader

    You did not call Read() - look at the docs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts