public void this_qry(ref DataTable pm_dt) 《------------ 这个是我自定义的方法
{
SQLHelper a = new SQLHelper(); //这个是用来连接数据库的
DataSet ds1 = a.WS(null, _this_sql); //执行查询语句的
if (a.sqlcode == -1)
{
return;
}
if (ds1.Tables[0].Rows.Count > 0)
{
for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
{
DataRow dr1 = pm_dt.NewRow(); ///运行到这里的时候 程序就异常跳出了
请各位大侠多多赐教 小弟在此有礼了
{
SQLHelper a = new SQLHelper(); //这个是用来连接数据库的
DataSet ds1 = a.WS(null, _this_sql); //执行查询语句的
if (a.sqlcode == -1)
{
return;
}
if (ds1.Tables[0].Rows.Count > 0)
{
for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
{
DataRow dr1 = pm_dt.NewRow(); ///运行到这里的时候 程序就异常跳出了
请各位大侠多多赐教 小弟在此有礼了
http://msdn.microsoft.com/zh-cn/library/system.data.datatable.newrow(v=vs.80).aspx
但是ds1.Tables[0].NewRow();应该没问题