2013-11-08
展开全部
public class Class1
{
static string ConnStr = "server=.;uid=sa;pwd=sa;database=bbs";
public static DataTable GetTable()
{
using (SqlConnection conn = new SqlConnection(ConnStr))
{
conn.Open();
SqlCommand cmd = new SqlCommand("select * from t1;select * from t2;select * from t3", conn);
SqlDataReader dr = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Columns.Add("aid", typeof(System.String));
dt.Columns.Add("aname", typeof(System.String));
do
{
while (dr.Read())
{
DataRow dtr = dt.NewRow();
dtr["aid"] = dr["aid"];
dtr["aname"] = dr["aname"];
dt.Rows.Add(dtr);
}
}
while (dr.NextResult());
return dt;
}
{
static string ConnStr = "server=.;uid=sa;pwd=sa;database=bbs";
public static DataTable GetTable()
{
using (SqlConnection conn = new SqlConnection(ConnStr))
{
conn.Open();
SqlCommand cmd = new SqlCommand("select * from t1;select * from t2;select * from t3", conn);
SqlDataReader dr = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Columns.Add("aid", typeof(System.String));
dt.Columns.Add("aname", typeof(System.String));
do
{
while (dr.Read())
{
DataRow dtr = dt.NewRow();
dtr["aid"] = dr["aid"];
dtr["aname"] = dr["aname"];
dt.Rows.Add(dtr);
}
}
while (dr.NextResult());
return dt;
}
2013-11-08
展开全部
ondatabound(){
if (datarow) e.item(index).tostring() mod 3==1
response.write(<br>)
}
if (datarow) e.item(index).tostring() mod 3==1
response.write(<br>)
}
本回答被网友采纳
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询