我晕~~
怎么没人来看啊
都怎么了啊我有写了一个调试用的函数啊
如下;
()
我写了个函数如下
public void show_row()
{
int count,row_count;
string str;
count = order.Tables["Table"].Rows.Count ;
row_count = order.Tables["Table"].Columns.Count;
for ( int i=0; i<count; i++)
{
DataRow row = order.Tables["Table"].Rows[i];
for(int m=0; m<row_count; m++)
{
str = Convert.ToString(row[m]);
}
当m=5的时候啊
发现在FILL之后那个str还是没值啊
是什么原因呢?
怎么没人来看啊
都怎么了啊我有写了一个调试用的函数啊
如下;
()
我写了个函数如下
public void show_row()
{
int count,row_count;
string str;
count = order.Tables["Table"].Rows.Count ;
row_count = order.Tables["Table"].Columns.Count;
for ( int i=0; i<count; i++)
{
DataRow row = order.Tables["Table"].Rows[i];
for(int m=0; m<row_count; m++)
{
str = Convert.ToString(row[m]);
}
当m=5的时候啊
发现在FILL之后那个str还是没值啊
是什么原因呢?
解决方案 »
- SystemState类和SystemProperty类
- C#API 遨游浏览器地址栏句柄实现转向功能 AccExplorer32.exe的使用
- 高手遇到过这样的问题吗?--ora-01000:超出打开的游标的最大数\n,有遇到并解决了的,帮小弟详解下吧,非常感谢!!
- 软件打开好慢啊,有没有好的解决方案?大背景图片360K,另外还有一些背景图片也一起加载,大概500K左右,这个有没有影响?及其他注意的地方
- 假设已创建Student类的3个对象stu1、stu2和stu3,下面C#代码的运行结果是
- 为什么WndProc不能处理ShowWindow发的SW_MINIMIZE命令?
- 自定义控件的属性编辑器问题!谢
- 如何实现启动外部程序并等待结束的过程?
- 用C#复制打开的Excel文件并再打开
- 入门级问题,C#的16进制表示的问题
- C# 可以调用Java的webservice么?
- 有关TreeView的问题
{
//创建数据库
order = new DataSet("OrderData");
//创建表
table = new DataTable("Table");
//middle = new DataTable("middle");
//tail = new DataTable("Tail");
//创建例
System.Data.DataColumn Provide = new DataColumn("provide",typeof(System.String));
System.Data.DataColumn Datetime = new DataColumn("datatime",typeof(System.DateTime));
System.Data.DataColumn OrderID = new DataColumn("orderid",typeof(System.Int32));
System.Data.DataColumn Warename = new DataColumn("warename",typeof(System.String ));
System.Data.DataColumn Unit = new DataColumn("unit",typeof(System.String));
System.Data.DataColumn Count = new DataColumn("count",typeof(System.Int32));
System.Data.DataColumn Unitprice = new DataColumn("unitprice",typeof(System.Double ));
System.Data.DataColumn Sum = new DataColumn("sum",typeof(System.Double));
System.Data.DataColumn Re = new DataColumn("re",typeof(System.String));
System.Data.DataColumn Operation = new DataColumn("operation",typeof(System.String));
//把例添加到表中
table.Columns.Add(OrderID);
table.Columns.Add(Provide);
table.Columns.Add(Datetime);
table.Columns.Add(Warename);
table.Columns.Add(Unit);
table.Columns.Add(Count);
table.Columns.Add(Unitprice);
table.Columns.Add(Sum);
table.Columns.Add(Re);
table.Columns.Add(Operation);
//设主键
//System.Data.DataColumn[ ] Pk = new DataColumn[ ]{OrderID};
//table.PrimaryKey = Pk;
//把表添加到内存数据库
order.Tables.Add(table);
}
}
}public String Str_err
{
get { return Str_error; }
set { Str_err = value;}
} public DataRow row
{
get { return Ora_row; }
set { Ora_row = value;}
} public string[] Str_row
{
get { return Ora_arr;}
set{ Ora_arr = value;}
} public Order_table()
{
//
// TODO: 在此处添加构造函数逻辑
//
BuildTable();
BuildOrderTable();
//Connection();
FillOrder();
} protected void BuildOrderTable()
{
//添加例
System.Data.DataColumn Deldatetime = new DataColumn("deldatetime",typeof(System.DateTime));
System.Data.DataColumn Deladr = new DataColumn("deladr",typeof(System.String ));
System.Data.DataColumn Tax = new DataColumn("tax",typeof(System.Double ));
//添加到表中去
order.Tables[0].Columns.Add(Deldatetime);
order.Tables[0].Columns.Add(Deladr);
order.Tables[0].Columns.Add(Tax);
}
public void FillOrder()
{
string Str_com = "select OrderID, Provide, DateTime, WareName, Unit, Counts, UnitPrice, Sums, Re, Operation, DelDateTime, DelAdr, Tax from Orders";
Str_con = "workstation id=\"CQRQ-228E08064B\";packet size=4096;user id=order;password=\"42964304\";data source=\"CQRQ" +
"-228E08064B\";persist security info=False;initial catalog=gpd";
Ora_con = new SqlConnection(Str_con);
Ora_con.Open();
Ora_com = new SqlCommand(Str_con,Ora_con);
Ora_ada = new SqlDataAdapter(Str_com,Ora_con);
try
{
Ora_ada.Fill(order,"Table");
Ora_con.Close();
}
catch (Exception ev)
{
Str_err = ev.Message ;
}
show_row();
}
{
DataRow curRow = order.Tables["Table"].NewRow();
//curRow["orderid"] = Ora_arr[0];
curRow["provide"] = Ora_arr[0];
curRow["datetime"] = Ora_arr[1];
curRow["warename"] = Ora_arr[2];
curRow["unit"] = Ora_arr[3];
curRow["count"] = Ora_arr[4];
curRow["unitprice"] = Ora_arr[5];
curRow["sum"] = Ora_arr[6];
curRow["re"] = Ora_arr[7];
curRow["operation"] = Ora_arr[8];
curRow["deldatetime"] = Ora_arr[9];
curRow["deladr"] = Ora_arr[10];
curRow["tax"] = Ora_arr[11];
order.Tables["Table"].Rows.Add(curRow);
} public void RowtoString()
{
DataRow[] curRow = order.Tables["Table"].Select("orderid =" + Convert.ToString(id));
Ora_arr = new string[] {
Convert.ToString(curRow[0]["provide"]),
Convert.ToString(curRow[0]["datetime"]),
Convert.ToString(curRow[0]["warename"]),
Convert.ToString(curRow[0]["unit"]),
Convert.ToString(curRow[0]["count"]),
Convert.ToString(curRow[0]["unitprice"]),
Convert.ToString(curRow[0]["re"]),
Convert.ToString(curRow[0]["sum"]),
Convert.ToString(curRow[0]["operation"]),
Convert.ToString(curRow[0]["deldatetime"]),
Convert.ToString(curRow[0]["deladr"]),
Convert.ToString(curRow[0]["tax"])
};
//string a = Convert.ToString(curRow[0]["count"]);
}
public void show_row()
{
int count,row_count;
string str;
count = order.Tables["Table"].Rows.Count ;
row_count = order.Tables["Table"].Columns.Count;
for ( int i=0; i<count; i++)
{
DataRow row = order.Tables["Table"].Rows[i];
for(int m=0; m<row_count; m++)
{
str = Convert.ToString(row[m]);
}
}
}