471,306 Members | 1,207 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 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 1416
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by pete K | last post: by
2 posts views Thread by IGotYourDotNet | last post: by
3 posts views Thread by CVerma | last post: by
1 post views Thread by Mirek Endys | last post: by
1 post views Thread by Craig | last post: by
2 posts views Thread by Laura K | last post: by
3 posts views Thread by Mirek Endys | last post: by
2 posts views Thread by scottls | last post: by
3 posts views Thread by Crazy Cat | last post: by
reply views Thread by rosydwin | last post: by

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.