createDataSource, and add new rows on the datagrid to be filled out.
2005-09-15 15:59
615 查看
DataTable createDataSource()
{
string strConn="server=localhost;database=LIMS;uid=sa;pwd=sa;";
string strSql = "select * from arrear where guestName = '" + id2 + "'";
SqlDataAdapter da = new SqlDataAdapter(strSql,new SqlConnection(strConn));
DataSet ds = new DataSet();
da.Fill(ds);
DataSet ds1 = ds.Clone();
dt = ds1.Tables[0];
//
int i,k=0 ;
for(i=0;i< ds.Tables[0].Rows.Count;i++)
dt.ImportRow(ds.Tables[0].Rows[i]);
Session["ItemIndex"] = (object)(i);
for(int j=(i%10);j<10;j++,k++)
{
dt.Rows.Add(dt.NewRow());
dt.Rows[i+k][3] = "null";//set the column's style
}
return dt;
}
{
string strConn="server=localhost;database=LIMS;uid=sa;pwd=sa;";
string strSql = "select * from arrear where guestName = '" + id2 + "'";
SqlDataAdapter da = new SqlDataAdapter(strSql,new SqlConnection(strConn));
DataSet ds = new DataSet();
da.Fill(ds);
DataSet ds1 = ds.Clone();
dt = ds1.Tables[0];
//
int i,k=0 ;
for(i=0;i< ds.Tables[0].Rows.Count;i++)
dt.ImportRow(ds.Tables[0].Rows[i]);
Session["ItemIndex"] = (object)(i);
for(int j=(i%10);j<10;j++,k++)
{
dt.Rows.Add(dt.NewRow());
dt.Rows[i+k][3] = "null";//set the column's style
}
return dt;
}
相关文章推荐
- [Graphics] UIColor created with component values far outside the expected range, Set a breakpoint on UIColorBreakForOutOfRangeColorComponents to debug. This message will only be logged once.
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
- 奇葩问题:This file could not be checked in because the original version of the file on the server was moved or deleted. A new version of this file has been saved to the server, but your check-in comments were not saved
- MS bug "The connection pool" in Oracle 10g and the data sort according to specified filed on DataGrid control.
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
- this bundle is invalid . new apps and app updates submitted to the app store must be built with publ
- Download and run CSQL on Linux -Only two commands will be used to start the server
- Use the Stack mehod and a temporary Stack to retrieve entries from the Stack source and add
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
- This tip shows how to extract the width and height from a bitmap source file on disk.
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
- his bundle is invalid . new apps and app updates submitted to the app store must be built with publi
- How to add the selinux policy access for the new created linux file node.
- fix errors 1088: “Failed to execute request because the App-Domain could not be created. Error: 0x80070005 Access is denied” and 1334: “Exception: System.IO.FileLoadException”
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built with
- Row index must be greater than or equal to zero and less than the number of rows.
- 【Visual Studio】The project appears to be under source control, but the associated source control plug-in is not installed on this computer
- SQL Server2008: The Changes you have made require the following tables to be dropped and re-created
- How to provide the capability to expand empty rows of a master view to be able to add child rows
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit