读取记录给textbox,菜鸟来送分了`` 从表里读数据,然后把读出的行记录分别辅值给textBox.不懂,请教,不丢人`` 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 textbox.text=table.rows[i][j].tostring();i和j是表里的行列标 你是用什么渎值的是用datareader吗?textbox.text=dr.[] 两个方法都行啊,建议用datareader 用sqldataadpater读取到dataset,然后想从dataset中的datatable读值到textboxstring selString2 = "select * from CostInvoice_TT where GoodsNumber = '"+goodsNumber+"'"; this.sqlDataAdapter2.SelectCommand.CommandText = selString2; this.sqlDataAdapter2.SelectCommand.CommandType = CommandType.Text; this.sqlDataAdapter2.SelectCommand.Connection = this.sqlConnection1; this.dataSet12.Clear(); this.sqlDataAdapter2.Fill(this.dataSet12,"CostInvoice_TT"); ..... //这里不知道怎么写`` textBox1.Text = DataTable.Rows[1][1].ToString(); 楼主这样 问想必 读取出来的 记录 只有一条了 DataSet ds= // 返回记录集 this.textbox1.Text=ds.tables[0].rows[0]["列名"].tostring(); this.textbox2.Text=ds.tables[0].rows[0]["列名"].tostring(); 搞定了。string selString2 = "select * from CostInvoice_TT where GoodsNumber = '"+goodsNumber+"'"; this.sqlDataAdapter2.SelectCommand.CommandText = selString2; this.sqlDataAdapter2.SelectCommand.CommandType = CommandType.Text; this.sqlDataAdapter2.SelectCommand.Connection = this.sqlConnection1; this.dataSet12.Clear(); this.sqlDataAdapter2.Fill(this.dataSet12,"CostInvoice_TT"); textBox1.Text = this.dataSet12.Tables["CostInvoice_TT"].Rows[0][1].ToString(); 用sqldataadpater读取到dataset,然后想从dataset中的datatable读值到textboxstring selString2 = "select * from CostInvoice_TT where GoodsNumber = '"+goodsNumber+"'"; this.sqlDataAdapter2.SelectCommand.CommandText = selString2; this.sqlDataAdapter2.SelectCommand.CommandType = CommandType.Text; this.sqlDataAdapter2.SelectCommand.Connection = this.sqlConnection1; this.dataSet12.Clear(); this.sqlDataAdapter2.Fill(this.dataSet12,"CostInvoice_TT"); ..... //这里不知道怎么写`` textBox1.Text = DataTable.Rows[1][1].ToString();=======================================================================填充 到 dataSet12 之后,,就用 这个记录集textBox1.Text =dataSet12.Tables[0].Rows[1][1].ToString(); 依次类推.................. sql语句中关于UPDATE的语法问题 窗体间传值问题 winform中如何将一个集合中的数据用Use MSXML API保存起来 tree view获取节点文件的完整路径, 没有分了,axMSFlexGrid 控制单元格的背景颜色 给讲一下如何返回字符串数组 求.net下Web能用的文件管理器 控件或者页面 现成的 找了好几个都不能用!求救 像这种情况怎么解决呢?急急急!!谢谢!谢谢了! 怎样在datagrid中删除选中的多行 关于delegate委托的问题 C#保存,新增,删除,修改数据,怎么提交数据库.在线等.解决马上结贴 谁知道word文档中的表格合并后,怎么解决换行的问题
i和j是表里的行列标
是用datareader吗?
textbox.text=dr.[]
string selString2 = "select * from CostInvoice_TT where GoodsNumber = '"+goodsNumber+"'";
this.sqlDataAdapter2.SelectCommand.CommandText = selString2;
this.sqlDataAdapter2.SelectCommand.CommandType = CommandType.Text;
this.sqlDataAdapter2.SelectCommand.Connection = this.sqlConnection1;
this.dataSet12.Clear();
this.sqlDataAdapter2.Fill(this.dataSet12,"CostInvoice_TT");
..... //这里不知道怎么写``
textBox1.Text = DataTable.Rows[1][1].ToString();
this.textbox2.Text=ds.tables[0].rows[0]["列名"].tostring();
string selString2 = "select * from CostInvoice_TT where GoodsNumber = '"+goodsNumber+"'";
this.sqlDataAdapter2.SelectCommand.CommandText = selString2;
this.sqlDataAdapter2.SelectCommand.CommandType = CommandType.Text;
this.sqlDataAdapter2.SelectCommand.Connection = this.sqlConnection1;
this.dataSet12.Clear();
this.sqlDataAdapter2.Fill(this.dataSet12,"CostInvoice_TT");
textBox1.Text = this.dataSet12.Tables["CostInvoice_TT"].Rows[0][1].ToString();
string selString2 = "select * from CostInvoice_TT where GoodsNumber = '"+goodsNumber+"'";
this.sqlDataAdapter2.SelectCommand.CommandText = selString2;
this.sqlDataAdapter2.SelectCommand.CommandType = CommandType.Text;
this.sqlDataAdapter2.SelectCommand.Connection = this.sqlConnection1;
this.dataSet12.Clear();
this.sqlDataAdapter2.Fill(this.dataSet12,"CostInvoice_TT");
..... //这里不知道怎么写``
textBox1.Text = DataTable.Rows[1][1].ToString();
=======================================================================
填充 到 dataSet12 之后,,就用 这个记录集textBox1.Text =dataSet12.Tables[0].Rows[1][1].ToString(); 依次类推..................