473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

New to VB.NET...HELP REQUIRED IMMEDIATELY

Hi,
I'm new to VB.NET..I'm developing a login page...im getting this error..

System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is Open, Fetching. at System.Data.OleDb.OleDbCommand.ValidateConnectionA ndTransaction(String method, Int32& localState) at System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior behavior) at System.Data.OleDb.OleDbCommand.ExecuteReader() at bt.index.Page_Load(Object sender, EventArgs e) in d:\inetpub\wwwroot\bt\index.aspx.vb:line 56
The code in .aspx.vb page is
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
Try

Dim MyConn As OleDbConnection = New OleDbConnection(ConfigurationSettings.AppSettings( "strConn"))
Dim strVisitor As String
Dim visitorCmd As OleDbCommand
Dim vRdr As OleDbDataReader
strVisitor = "select max(v_id) from visitor"
visitorCmd = New OleDbCommand(strVisitor, MyConn)
MyConn.Open()
Dim old_visitor As Integer
Dim new_visitor As Integer

vRdr = visitorCmd.ExecuteReader()
While vRdr.Read()
If Not IsDBNull(visitorCmd.ExecuteReader()) Then
old_visitor = vRdr.Item(0)
End If
End While

new_visitor = old_visitor + 1
lblvisitor.Text = new_visitor
MyConn.Close()

Catch ex As Exception
Response.Write(ex)
End Try

End If
End Sub

Your help will be much appreciated

--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #1
0 731

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
9
by: Martin | last post by:
Hello, I'm new with triggers and I can not find any good example on how to do the following: I have two tables WO and PM with the following fields: WO.WONUM, VARCHAR(10) WO.PMNUM,...
7
by: Swilson513 | last post by:
I'm trying to make what should be a simple DB, but have done got myself confused. I'm trying to keep track of the contents of several kits that use common components. Each component has a unique...
1
by: Stephen | last post by:
Was wondering if someone could please help me with an array I'd like to create in an asp.net page. I have to design an array which stores the values of addresses manually entered into textboxes...
2
by: siliconpiNOSPAM | last post by:
Hi, I'm writing a program that should accept the following parameters: XMLfile (required) Logfile (required) /A (append flag, optional) /D 123 (delay value, optional, but # should follow /D...
6
by: paul | last post by:
HI! How do we send a variable from an Iframe page back to its parent? I have a script that calculates the iframe's window size but I need to know how to send that value back to its parent so I...
13
by: ern | last post by:
I'm using strtok( ) to capture lines of input. After I call "splitCommand", I call strtok( ) again to get the next line. Strtok( ) returns NULL (but there is more in the file...). That didn't...
9
by: weidongtom | last post by:
Hi, I've written the code that follows, and I use the function add_word(), it seems to work fine *before* increase_arrays() is called that uses realloc() to allocate more memory to words. But...
0
by: Frank Gallagher | last post by:
July 8 2008 Governments are far more corrupt than anyone would believe other than the members of Charter Democracy Force www.cdf.name who have a prodigious amount of irrefutable evidence and are...
4
by: blurboy | last post by:
Mdi Container - frmMdiContainer Child Form - frmChildForm however in my frmChildForm, i have a button to open another form - frmSpecial. In order to open frmSpecial in the frmMdiContainer (like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.