Solved

System.Data.OleDb.OleDbException: Unspecified error

Posted on 2012-04-03
6
331 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now