Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2008-06-17 : 14:04:06
|
Hi Group:I need help with the following piece of code in VB.Net 2005. I am trying to filled out a drop down list, when the page load. However, I am receiving the following error. Any help is truly appreciate it. ON Page Load ' Loads the drop down lists LoadDropDown(ddlNet, "N") 'LoadDropDown(ddlSecurityClass, "C")________________________________________________________'Run a Stored Procedure to get the data set for the drop down list Private Sub LoadDropDown(ByVal ddl As DropDownList, ByVal Query As String) Try ' Create a new instance of the stored proc Session("stpInfa") = New SQLServer.swnStoredProc(ConfigurationManager.ConnectionStrings("conODS").ConnectionString, "swn_sp_ODS_CompanyHierarchySecurity") 'Select specific record after the user enter the Gen & Sub Session("stpInfa").addparameter("@SQLType", SqlDbType.VarChar, 10, Query) ' Execute the stored proc for the specific record Session("stpInfa").executeproc() 'Bind the data to the drop down list ddl.DataSource = Session("stpInfa").datatable(0) ddl.DataTextField = Session("stpInfa").datatables(0).Columns(1).ToString ddl.DataValueField = Session("stpInfa").datatable(0).Columns(0).ToString ddl.DataBind() ddl.Items.Insert(0, "Select a " & dsTableData.Tables(0).Columns(1).ToString) Catch Xcp As Exception txtErrorMessage.Text += "Error Loading Drop Down - " & Xcp.Message & Chr(10) & Chr(13) txtErrorMessage.Visible = "True" End Try End SubThanks, |
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2008-06-17 : 14:04:48
|
Error Loading Drop Down - Overload resolution failed because no accessible 'datatable' accepts this number of arguments.This is the complete Error Message |
|
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2008-06-17 : 15:14:43
|
Ok. Does anyone know how to break down the Binding Drop Down List, so I can test each part to find the problem. ddl.DataSource = Session("stpInfa").datatable(0)ddl.DataTextField = Session("stpInfa").datatables(0).Columns(1).ToStringddl.DataValueField = Session("stpInfa").datatable(0).Columns(0).ToStringddl.DataBind()I know is hard to find how to solve a problem without running the debug. But if someone can help me break it down into pieces. I can try debug it on my machine.Thanks All!!!!! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-06-17 : 15:16:45
|
Have you tried posting your question on a.NET forum such as the ones over at www.asp.net? We have only about 5 people who post answers here for .NET questions, so you'll have much better luck on a site that deals with .NET primarily. Our primary focus here is SQL Server.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
|
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2008-06-17 : 15:18:31
|
Thanks Tara, I will try that. |
|
|
|
|
|
|
|