Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 7th, 2003, 04:13 AM
Registered User
 
Join Date: Aug 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting to an oledb datasource

Hi
i am just converting to asp.net from classic and am having trouble with connecting and displaying data from a MSACCESS datasource. i have written a very basic script and after numerous tries i think i managed to open the database but i now get a "No data exists for row/column". There is data there but i have obviously missed something. Below is my code, please can anybody help!!

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@Page Language="VB" Explicit="True"%>
<script language="vb" runat="server">
sub page_load()
dim strsource as string ="Provider=microsoft.jet.oledb.4.0;Data Source=e:\web databases\stationary.mdb"
dim sqltext as string="select * from stationary"

dim StrResult as string

dim objconn as new oledbconnection(strsource)
dim objcom as new oledbcommand(sqltext, objconn)

dim objdatareader as oledbdatareader
objconn.open()

objdatareader=objcom.executereader()

StrResult +=objdatareader("item")
end sub
</script>


Reply With Quote
  #2 (permalink)  
Old August 7th, 2003, 03:57 PM
Authorized User
 
Join Date: Jul 2003
Location: Ahmedabad, gujarat, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Indian Ocean Send a message via Yahoo to Indian Ocean
Default

hi,
you are using your mdb name in select query,
in query there should be a table name. Is that so?
just check it.

Indian Ocean
"Rago Me Daudate Firne Ke Hum Nahi Kayal;
Jo Aankh Hi Se Na Tapka To Fir Lahoo Kya!"
Reply With Quote
  #3 (permalink)  
Old August 7th, 2003, 04:05 PM
Registered User
 
Join Date: Aug 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try Opening your connection before sending it to your command.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I work with OLEDB? avaricious programmer SQL Language 0 January 17th, 2007 06:15 PM
Object datasource VS DataSource SoftMind BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 July 27th, 2006 10:44 PM
Using Jet OLEDB sureshkumarct Visual C++ 0 May 30th, 2006 02:00 AM
OleDb.Net vs. ODBC.Net for Connecting to Oracle cjo ASP.NET 1.0 and 1.1 Professional 3 January 13th, 2004 07:18 PM
OleDb.Net vs. ODBC.Net for Connecting to Oracle cjo ASP.NET 1.0 and 1.1 Basics 1 December 23rd, 2003 10:56 AM



All times are GMT -4. The time now is 09:31 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.