【发布时间】:2015-06-08 09:44:28
【问题描述】:
我想根据下拉列表中的选择使用值填充我的文本框。
DAL:
public static string GetTicket(collection b)
{
try
{
string returnValue = string.Empty;
DB = Connect();
DBCommand = connection.Procedure("getTicket");
DB.AddInParameter(DBCommand, "@SupportRef", DbType.String, b.SupportRef1);
var myReader = DBCommand.ExecuteReader();
while (myReader.Read())
{
returnValue = myReader.GetString(0);
}
return returnValue;
}
catch (Exception ex)
{
throw ex;
}
BLL:
public string returnTicket(collection b)
{
try
{
string ticket = DAL.data.GetTicket(b);
return ticket;
}
catch (Exception ex)
{
throw ex;
}
}
PL:
protected void ddl_Customers_SelectedIndexChanged(object sender, EventArgs e)
{
string selectedValue = ddl_Customers.SelectedValue.ToString();
//populate the text boxes
txtSupportRef.Text = bobj.returnTicket(selectedValue);
}
我的存储过程有一个名为 SupportRef 的变量,它需要一个值才能返回结果。
我收到以下错误:
The best overloaded method match for 'BLL.business.returnTicket(DAL.collection)'
has some invalid arguments
与
Argument 1: cannot convert from 'string' to 'DAL.collection'
【问题讨论】:
-
你传递的是一个字符串,而不是一个集合对象..?
-
从表单中我传入一个字符串值
-
请贴出班级
DAL.collection的结构。这样我们就可以帮助您将string类型转换为DAL.collection类型。