Link to home
Start Free TrialLog in
Avatar of Amien90
Amien90

asked on

System.Data.OleDb.OleDbException: Unspecified error

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
Avatar of masterpass
masterpass
Flag of India image

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!
Avatar of Amien90
Amien90

ASKER

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?
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!
Avatar of Amien90

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of masterpass
masterpass
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Amien90

ASKER

Thanks