Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.Net SQLdatareader

Status
Not open for further replies.

NeilV

Programmer
Oct 14, 2002
117
GB
Hello,

I am using ASP.net and its SQLdatareader to extract some information from a database and display it on a web page. while in normal ASP this is v v simple, I can't seem to manage it in ASP.net. my code is as follows:

Dim Conn As SqlConnection

Dim SQLCommand2
Dim DataReader As SQlDataReader

Conn = New SqlConnection("server=myserver;" _
& "database=mydb;uid=sa")

'get seat info
SQLCommand2 = new SQLCommand(MySQL,Conn)

conn.open()
DataReader = Sqlcommand2.ExecuteReader()

temp = datareader("production_id").tostring()
response.write("temp")

However, when i run this i get the following error:
System.IndexOutOfRangeException: production_id
What does this mean??and how can i fix it???!!!

Cheers,

Neil

PS I realise this is an ASP forum, but there isn't an ASP.net forum so i've posted on here

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top