Solved

System.Data.OleDb.OleDbException: Unspecified error

Posted on 2012-04-03
6
341 Views
Last Modified: 2012-04-03
i changed this:

 <asp:DropDownList ID="ddlProducts" runat="server" DataSourceID="AccessDataSourceProducts"
                        DataTextField="ProductName" DataValueField="ProductID" 
                        AppendDataBoundItems="True" Width="302px" TabIndex="9019"  
                      >
                         <asp:ListItem Text="" Value="" />
                    </asp:DropDownList>

Open in new window


into this:

  If e.Row.RowType = DataControlRowType.DataRow Then
            Dim cmd As New OleDb.OleDbCommand("SELECT DISTINCT * FROM [Products] ORDER BY ProductName ", con)

            Dim ddlProducts As DropDownList = CType(e.Row.FindControl("ddlProducts"), DropDownList)

            Dim da As New OleDbDataAdapter(cmd)

            Dim ds As New DataSet()
            da.Fill(ds)

            ddlProducts.DataTextField = ds.Tables(0).Columns("ProductName").ToString()
            ddlProducts.DataValueField = ds.Tables(0).Columns("ProductID").ToString()

            ddlProducts.DataSource = ds.Tables(0)
            ddlProducts.DataBind()

            ds.Dispose()

        End If

Open in new window


and now i get this error:
System.Data.OleDb.OleDbException: Unspecified error
GridView1.DataBind()

Do i need to Dispose/Close something else? error is only there when alot of data is pulled from the database. I only have this issue when the website is published on the server. Locally i don't get this error. IIS as webserver
0
Comment
Question by:Amien90
  • 3
  • 3
6 Comments
 
LVL 21

Expert Comment

by:masterpass
ID: 37803587
I think it should be some permission issue in the server. Have a look here

http://msmvps.com/blogs/rakeshrajan/archive/2005/07/04/56461.aspx

hope this helps!
0
 

Author Comment

by:Amien90
ID: 37803623
why? i have a gridview that contains dropdownlist .. i'm populating these droplists.

When i create 25 rows no problem, when i create 100 rows i get the above error? can that still be a permission error?
0
 
LVL 21

Expert Comment

by:masterpass
ID: 37803773
Did you go through that link. If the ASP.NET account in the server does not have permission to access the database then it can throw this error!
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Amien90
ID: 37803788
yes .. but the server has full permission.

I dont see a permission issue when 25 rows are no problem and 100 rows are a problem. How can permission be a problem? i also split the 100 rows into 4 parts and those 4 parts are also no problem
0
 
LVL 21

Accepted Solution

by:
masterpass earned 500 total points
ID: 37803856
can you try this

con.Open()

Dim ds As New DataSet()
da.Fill(ds)

con.Close()

Open in new window

0
 

Author Closing Comment

by:Amien90
ID: 37804093
Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question