Hi,
I was using the code below to pull up records from an access database which worked fine, but I now want to do the same to a foxpro 7 database.
It connects to the foxpro dbase but after stepping through the code I found it crashes at
"dgPrevious.DataSource = cmdSelect.ExecuteReader"
the error is "Object reference not set to an instance of an object."
Dim con As OleDb.OleDbConnection
Dim cmdSelect As OleDb.OleDbCommand
Call OpenConnection() ' Own procedure
sqlquery = "SELECT Datereq, NetLogin, Title, Status, RequestId FROM " & tbname
cmdSelect = New OleDb.OleDbCommand(sqlquery, con)
dgPrevious.DataSource = cmdSelect.ExecuteReader
dgPrevious.DataBind()
Thanks
ChrisBy experience I find that if there is a problem with db connection it fails after code for connection but when you apply it.
Can you post the code for Call OpenConnection() ?
I suspect there is a problem here (perhaps).
Showing posts with label pull. Show all posts
Showing posts with label pull. Show all posts
Thursday, March 22, 2012
Friday, March 16, 2012
On Enter
I have an asp.net page built to pull history from a SQL 2000 database.
I have the user enter a number in a text box and then click on the button to find & display the history.
Everything happens when they click on the button.
How do I make it happen if they hit the Enter key after typing in their number?
I want it to work both ways...hitting Enter or clicking the button.
Thanks!Reffer to this post :
http://www.vbforums.com/showthread.php?t=346036
Excellent!
This worked for me!
Thanks!
I have the user enter a number in a text box and then click on the button to find & display the history.
Everything happens when they click on the button.
How do I make it happen if they hit the Enter key after typing in their number?
I want it to work both ways...hitting Enter or clicking the button.
Thanks!Reffer to this post :
http://www.vbforums.com/showthread.php?t=346036
Excellent!
This worked for me!
Thanks!
Subscribe to:
Posts (Atom)