表示层:
int ID = int.Parse(Request.QueryString["ID"]);
bll.Update_Hit(ID);
if(bll.Get_VideoURL(ID).Read())
{
string URL = bll.Get_VideoURL(ID).GetValue(6).ToString();
Response.Redirect(URL);
Response.End();
}
会提示"不存在此行此列"如果重新声明一个DataReader对象来使用就不会..这样的话不是破坏多层结构了么...基类的方法:
public static OleDbDataReader ExcuteReader(string strSQL)
{
OleDbConnection Connection = new OleDbConnection(ConnString);
OleDbCommand Cmd = new OleDbCommand(strSQL,Connection);
try
{
Connection.Open();
OleDbDataReader MyReader = Cmd.ExecuteReader(CommandBehavior.CloseConnection);
return MyReader;
}
catch(Exception Ex)
{
throw new Exception(Ex.Message);
}
}
int ID = int.Parse(Request.QueryString["ID"]);
bll.Update_Hit(ID);
if(bll.Get_VideoURL(ID).Read())
{
string URL = bll.Get_VideoURL(ID).GetValue(6).ToString();
Response.Redirect(URL);
Response.End();
}
会提示"不存在此行此列"如果重新声明一个DataReader对象来使用就不会..这样的话不是破坏多层结构了么...基类的方法:
public static OleDbDataReader ExcuteReader(string strSQL)
{
OleDbConnection Connection = new OleDbConnection(ConnString);
OleDbCommand Cmd = new OleDbCommand(strSQL,Connection);
try
{
Connection.Open();
OleDbDataReader MyReader = Cmd.ExecuteReader(CommandBehavior.CloseConnection);
return MyReader;
}
catch(Exception Ex)
{
throw new Exception(Ex.Message);
}
}
解决方案 »
- SQL2005 根據條件字段串連的問題
- 求助,生成Excel时内存泄漏System.OutOfMemoryException
- 开帖问个奇怪的问题
- 能给我个.net分页控件么?
- gridview自定义控件 关于分页的写法
- asp.net2.0 母板 如何应用 主题
- 一个session在多个机子上一起用?
- 请问asp.net中还可以使用struct来定义结构以及使用类(class)吗?
- asp.net vs2008,gridview导出excel时如何取消其中的超链接?注意:不是模板列
- js读xml文件
- ????索引和长度必须引用该字符串内的位置。参数名: length
- checkedListBox的问题
然后业务曾BLL则获取数据层返回的结果,
再是表示层UI调用BLL得到返回结果