把conn.cs做成conn.dll形式后在asp.net中如何调用??
conn.cs:
using System;
using System.Data;
using System.Data.SqlClient;
namespace connn{
public class conn
{
public DataSet returnSet()
{
string mySelectQuery = "select * from class where name=rrr";
SqlConnection myConnection = new SqlConnection("server=localhost;uid=Aro;pwd=;database=master");
SqlCommand selectCMD = new SqlCommand(mySelectQuery,myConnection);
SqlDataAdapter custDA = new SqlDataAdapter();
custDA.SelectCommand = selectCMD;
myConnection.Open();
DataSet custDS = new DataSet();
custDA.Fill(custDS, "class");
return custDS;
}
}
}
把conn.cs做成conn.dll形式后,嵌入如下的程序中,会提示DataSource没有传到数值,麻烦大家解决一下,谢谢!
<%@ Page language="c#"%>
<%@ import namespace="System.Data"%>
<%@ import namespace="System.Data.SqlClient"%>
<%@ import namespace="connn"%>
<HTML>
<HEAD>
<script language="C#" runat="server">
private void Page_Load(Object Src,EventArgs E) {
DataSet custDS = new DataSet();
MyDataGrid.DataSource=custDS;
MyDataGrid.DataBind();
}
</script>
</HEAD>
using System;
using System.Data;
using System.Data.SqlClient;
namespace connn{
public class conn
{
public DataSet returnSet()
{
string mySelectQuery = "select * from class where name=rrr";
SqlConnection myConnection = new SqlConnection("server=localhost;uid=Aro;pwd=;database=master");
SqlCommand selectCMD = new SqlCommand(mySelectQuery,myConnection);
SqlDataAdapter custDA = new SqlDataAdapter();
custDA.SelectCommand = selectCMD;
myConnection.Open();
DataSet custDS = new DataSet();
custDA.Fill(custDS, "class");
return custDS;
}
}
}
把conn.cs做成conn.dll形式后,嵌入如下的程序中,会提示DataSource没有传到数值,麻烦大家解决一下,谢谢!
<%@ Page language="c#"%>
<%@ import namespace="System.Data"%>
<%@ import namespace="System.Data.SqlClient"%>
<%@ import namespace="connn"%>
<HTML>
<HEAD>
<script language="C#" runat="server">
private void Page_Load(Object Src,EventArgs E) {
DataSet custDS = new DataSet();
MyDataGrid.DataSource=custDS;
MyDataGrid.DataBind();
}
</script>
</HEAD>
...全文
相关推荐
不错的grid控件
不错的grid控件,晚上下载的,值得推广个共享。
C#初学控件不错看看吧
自己用的,还不错,看看吧!多提意见,谢谢
很不错的css日期控件
很不错的css日期控件很不错的css日期控件
整理了12款Javascript 表格控件(DataGrid)
12款JavaScript表格控件。表格控件(DataGrid )允许最终用户阅读和写入到绝大多数数据库的应用程序。DataGrid 控件可以在设计时快速进行配置,只需少量代码或无需代码。
C#界面分屏展示
C#界面任意分屏,可以平均分屏(即所有屏幕大小相同,按照设定数量平均分配);也可以按照自己的任意想法,把某些屏幕设置得与其他屏幕大小不一样(即可以设置几个大的,几个小的)。


