Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

System.Data.OleDb.OleDbException: Unspecified error

Posted on 2012-04-03
6
Medium Priority
?
356 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 2000 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

610 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