Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
request failed with no error - something to do with dbread=dbcomm.ExecuteReader()
Old 09-03-2010, 04:46 AM request failed with no error - something to do with dbread=dbcomm.ExecuteReader()
Junior Talker

Posts: 1
Name: Andrew
Trades: 0
I'm making a very simple webpage to view data in a Postgres tbale. Having not done this belore with ASP.NET I'm taking it slowly and overcoming most problems. However I cannot work out what is going on here: I get this message:

SERVER ERROR
'PostgreSQL OLE DB Provider' failed with no error message available, result code: -2147221163(0x80040155).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: 'PostgreSQL OLE DB Provider' failed with no error message available, result code: -2147221163(0x80040155).

Source Error:


Line 11: sql="SELECT table_name FROM nfmd_master"
Line 12: dbcomm=New OleDbCommand(sql,dbconn)
Line 13: dbread=dbcomm.ExecuteReader()Line 14: nfmd_master.DataSource=dbread
Line 15: nfmd_master.DataBind()


Source File: G:\wwwroot\internettest\cat.aspx Line: 13

Stack Trace:


[OleDbException (0x80040155): 'PostgreSQL OLE DB Provider' failed with no error message available, result code: -2147221163(0x80040155).]
Microsoft.VisualBasic.CompilerServices.Container.I nvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) +202
Microsoft.VisualBasic.CompilerServices.NewLateBind ing.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +275
ASP.cat_aspx.Page_Load() in G:\wwwroot\internettest\cat.aspx:13
System.Web.Util.CalliHelper.ArglessFunctionCaller( IntPtr fp, Object o) +8
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender, EventArgs e) +8668019
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627



MY CODE IS
Code:
<%@ Page Language="VB" Debug="true" %> 
<%@ Import Namespace="System.Data.OleDb" %> 
<script runat="server"> 
sub Page_Load 
dim dbconn,sql,dbcomm,dbread,nfmd_master 
dbconn=New OleDbConnection("Provider=PostgreSQL OLE DB Provider;Data Source=localhost;location=gis;User ID=postgres;password=password;") 
dbconn.Open() 
sql="SELECT table_name FROM nfmd_master" 
dbcomm=New OleDbCommand(sql,dbconn) 
dbread=dbcomm.ExecuteReader() 
nfmd_master.DataSource=dbread 
nfmd_master.DataBind() 
dbread.Close() 
dbconn.Close() 
end sub 
</script> 

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<title>PostGIS Data Catalogue</title> </head> 
<body> 
<form runat="server"> 
<asp:Repeater id="nfmd" runat="server"> 
<HeaderTemplate> 
<table border="1" width="100%"> <tr> <th>table_name</th> </tr> </HeaderTemplate>  
<ItemTemplate> <tr> <td><%#Container.DataItem("table_name")%></td>  </tr> </ItemTemplate>  
<FooterTemplate> 
</table> </FooterTemplate>  </asp:Repeater> 
</form>   
</body> </html>
can anyone help?


Thanks
Andrew http://bytes.com/topic/net/answers/8...-executereader

can anyone help?

Thanks
Andrew
can anyone help?

Thanks
Andrew

Last edited by chrishirst; 09-08-2010 at 05:24 PM.. Reason: Code not formated well
andynewforest is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-27-2010, 11:32 AM Re: request failed with no error - something to do with dbread=dbcomm.ExecuteReader()
Extreme Talker

Posts: 246
Trades: 0
I'm assuming the error you are getting has to do with your connection string.

Try the following:

On your desktop create a new file (a blank txt file). Rename it so that the extension is .udl

Once this is created, double click the icon. Use this to put in what provider, catalog, database, username, password... all the information to connect to your database. Click the test button. Once you have it working, open the file in notepad.

You now have the connection string you need in order to connect to your database.


Hope this helps.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
stbuchok is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to request failed with no error - something to do with dbread=dbcomm.ExecuteReader()
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31064 seconds with 12 queries