[求助]怎么把查询出来的多条记录显示在一个表格里面
我想把查询出来的东西用表格的形式显示出来怎么写代码呀?查询和显示都是在同一页上的。我在那个页面上加了一个GuidView,但是后面的怎么弄就不知道了,高手们指导一下呀,急用呢!
public OracleDataAdapter Query(String a)
{
OracleConnection conn = new OracleConnection();
conn.ConnectionString = "Data Source='"+getconn.OracleServiceName1+"';User ID='"+getconn.OracleUserId1+"';Password='"+getconn.OraclePassword1+"';";
try
{
conn.Open();
OracleCommand comm = new OracleCommand(a, conn);
OracleDataAdapter obj = new OracleDataAdapter(comm);
return obj;
}
catch(Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
String sql ="select ......";
OracleDataAdapter da = public OracleDataAdapter Query(String a)
{
OracleConnection conn = new OracleConnection();
conn.ConnectionString = "Data Source='"+getconn.OracleServiceName1+"';User ID='"+getconn.OracleUserId1+"';Password='"+getconn.OraclePassword1+"';";
try
{
conn.Open();
OracleCommand comm = new OracleCommand(a, conn);
OracleDataAdapter obj = new OracleDataAdapter(comm);
return obj;
}
catch(Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
String sql ="select ......";
OracleDataAdapter da = public OracleDataAdapter Query(String a)
{
OracleConnection conn = new OracleConnection();
conn.ConnectionString = "Data Source='"+getconn.OracleServiceName1+"';User ID='"+getconn.OracleUserId1+"';Password='"+getconn.OraclePassword1+"';";
try
{
conn.Open();
OracleCommand comm = new OracleCommand(a, conn);
OracleDataAdapter obj = new OracleDataAdapter(comm);
return obj;
}
catch(Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
String sql ="select ......";
OracleDataAdapter da =
public OracleDataAdapter Query(String a)
{
OracleConnection conn = new OracleConnection();
conn.ConnectionString = "Data Source='"+getconn.OracleServiceName1+"';User ID='"+getconn.OracleUserId1+"';Password='"+getconn.OraclePassword1+"';";
try
{
conn.Open();
OracleCommand comm = new OracleCommand(a, conn);
OracleDataAdapter obj = new OracleDataAdapter(comm);
return obj;
}
catch(Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
String sql ="select ......";
OracleDataAdapter da = Query(sql);
DataSet ds =new DataSet();
da.Fill(ds,"tt");
if(ds.Table["tt"].Rows.count>0)
{
GridView1.DataSource = ds.Table["tt"].DefaultView;
GridView1.DataBind();
}