Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.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
 
Old August 7th, 2003, 04:13 AM
Registered User
 
Join Date: Aug 2003
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>


 
Old August 7th, 2003, 03:57 PM
Authorized User
 
Join Date: Jul 2003
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!"
 
Old August 7th, 2003, 04:05 PM
Registered User
 
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try Opening your connection before sending it to your command.






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





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