473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Datalist DataSource Error

I am currently converting some VB.NET web apps to C#. It has been pretty
seamless so far but have currently run into some problems that I can't
resolve. The line that generates the error is:

The specific error is:

CS1502: The best overloaded method match for
'_Default.PopulateDrawingList(string)' has some invalid arguments

This is what is highlighted:

<asp:DataList ID="dlSheetType" cssclass="datalist1" DataSource='<%#
PopulateDrawingList(DataBinder.Eval(Container.Data Item,
"DrawingNumber")) %>' Runat="server">

The function referenced is:

public DataSet PopulateDrawingList(string DrawingNumber)
{
string strSQL = "SELECT Drawing, DCN, SheetNumber, SheetType, ADCN FROM
vwAllLatestrevSheetsWithADCN WHERE (Drawing = '" + DrawingNumber + "')
AND (State = 8) ORDER BY SheetType, SheetNumber, DCN, ADCN";

Dataset ds = new DataSet();
OleDbDataAdapter cm = new OleDbDataAdapter(strSQL, objConnSQL);
cm.Fill(ds, "DataTable");
ds.Tables["DataTable"].Columns.Add("NewADCN");
int dsRowCount = ds.Tables[0].Rows.Count;

for (int i=0; i <= dsRowCount; i++)
{
if (ds.Tables["DataTable"].Rows[i]["ADCN"] is DBNull)
{ds.Tables["DataTable"].Rows[i]["NewADCN"] = "&nbsp;";}
else
{ds.Tables["DataTable"].Rows[i]["NewADCN"] =
ds.Tables["DataTable"].Rows[i]["ADCN"];}
}
return ds.Tables[0];
}

Any suggestions as to where I can look to correct this problem?

*** Sent via Developersdex http://www.developersdex.com ***
Dec 1 '05 #1
1 1469
Hi,

The problem is in the eval , DataBinder.Eval(Container.DataItem,
"DrawingNumber") is not returning a string (or maybe it's a null string)
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Will Chamberlain" <wi**************@devdex.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am currently converting some VB.NET web apps to C#. It has been pretty
seamless so far but have currently run into some problems that I can't
resolve. The line that generates the error is:

The specific error is:

CS1502: The best overloaded method match for
'_Default.PopulateDrawingList(string)' has some invalid arguments

This is what is highlighted:

<asp:DataList ID="dlSheetType" cssclass="datalist1" DataSource='<%#
PopulateDrawingList(DataBinder.Eval(Container.Data Item,
"DrawingNumber")) %>' Runat="server">

The function referenced is:

public DataSet PopulateDrawingList(string DrawingNumber)
{
string strSQL = "SELECT Drawing, DCN, SheetNumber, SheetType, ADCN FROM
vwAllLatestrevSheetsWithADCN WHERE (Drawing = '" + DrawingNumber + "')
AND (State = 8) ORDER BY SheetType, SheetNumber, DCN, ADCN";

Dataset ds = new DataSet();
OleDbDataAdapter cm = new OleDbDataAdapter(strSQL, objConnSQL);
cm.Fill(ds, "DataTable");
ds.Tables["DataTable"].Columns.Add("NewADCN");
int dsRowCount = ds.Tables[0].Rows.Count;

for (int i=0; i <= dsRowCount; i++)
{
if (ds.Tables["DataTable"].Rows[i]["ADCN"] is DBNull)
{ds.Tables["DataTable"].Rows[i]["NewADCN"] = "&nbsp;";}
else
{ds.Tables["DataTable"].Rows[i]["NewADCN"] =
ds.Tables["DataTable"].Rows[i]["ADCN"];}
}
return ds.Tables[0];
}

Any suggestions as to where I can look to correct this problem?

*** Sent via Developersdex http://www.developersdex.com ***

Dec 5 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Antonio D'Ottavio | last post by:
Good Morning, In my web page I've a datalist that is sourced by a database, the problem is that I want that one of the column of the datalist contain a dropdownbox that also is sourced by a table...
1
by: pete K | last post by:
Is it possible in asp.net to have a datalist in the itemtemplate of another datalist? For example: <asp:datalist id="MyList" runat="server"> <ItemTemplate> <table border="0" width="300">...
2
by: IGotYourDotNet | last post by:
Can anyone tell me how to find a table within a datalist? I can find the labels and textboxes in the dl and change the formatting based on the data, but I can't find the table in the DL. Can anyone...
3
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
1
by: Mirek Endys | last post by:
Hi all, I thought, that this is an usual thing, but Im wrong. I have a DataList control and there is a Label control. I need to change the Text propertz of the Label control. How to do it....
1
by: Craig | last post by:
This is killing me, I've been trying to figure this out for 2 days. When I click on the linkbutton, it executes the GetData(int) method to set the DataSource. The FAILURE is when it tries to...
2
by: Laura K | last post by:
I would like to create a nested datalist inside the selecteditemtemplate of a datalist. My hope is that when a user clicks on a link a set of child links is displayed. For example if the user...
3
by: Mirek Endys | last post by:
I have DataList as part of DataList item. DataList in DataList. The parent DataList working well including Edit command, that shows Edit template and correctly bind the data into edit template...
2
by: scottls | last post by:
Hi All, Thanks for reading my post. I have been working on getting nested datalists working properly wihtin my framework for many days and I think I'm almost there. See if you could help me...
3
by: Crazy Cat | last post by:
Hi all, I am developing an asp.net 2.0 application in Visual Studio 2005. On my page I have a simple datalist that is bound programmatically to a collection of simple objects. On this page I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.