新手发问。(字符串型的值填到datetimepicker.text中) 绑定不错的,你试试:this.dateTimePicker1.DataBindings.Add("Value",dataSet.Tables[0],"TIME") 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 dataSet.Tables[0]为你的数据集中的表,TIME:为表中的字段。 dateTimePicker.Value=DateTime.Parse("2004-3-31"); 我在数据库中的字段类型是vcahr有没有问题? 谢谢大家。用fupip(小贝) 的方法可以。谢谢。我还想问一下,我从datagrid中单击,改变textBox.text的值时有时为什么对应的值不对呀。System.Windows.Forms.DataGrid.HitTestInfo hti;hti = this.dataGrid1.HitTest(e.X, e.Y);if (hti.Type==System.Windows.Forms.DataGrid.HitTestType.Cell) { textBox1.Text=dataset.Tables[0].Rows[hti.Row][0].ToString(); textBox1.Text=dataset.Tables[0].Rows[hti.Row][1].ToString(); dateTimePicker1.Value=System.DateTime.Parse(dataset.Tables[0].Rows[hti.Row][2].ToString().Trim()); comboBox1.Text =dataset.Tables[0].Rows[hti.Row][3].ToString(); textBox8.Text=dataset.Tables[0].Rows[hti.Row][4].ToString(); textBox3.Text=dataset.Tables[0].Rows[hti.Row][5].ToString(); textBox4.Text=dataset.Tables[0].Rows[hti.Row][6].ToString(); textBox5.Text=dataset.Tables[0].Rows[hti.Row][7].ToString(); textBox6.Text=dataset.Tables[0].Rows[hti.Row][8].ToString(); textBox7.Text=dataset.Tables[0].Rows[hti.Row][9].ToString();} DataGridView添加行号后,翻页继续上一页序号 如何获得远程计算机ip、mac、计算机名称? 怎样将button做成圆的 如何获取屏幕光标位置(C#) 一个XML的字符串怎么去解析 給報表傳遞數據源是這樣嗎 在Web页面中怎样对用户发送的密码进行加密(从客户端到服务器端的传输过程)?顶者有分了!! 那位兄弟用过delphi开发的客户端调用过.net开发的中间件,忘指点! 一個字符串加密的問題! 怎么编译www.aspxcn.com的下载的代码呀?怎么设置,可肯定有搞过的吧! 如何在左键菜单中增加一个带图标的文件夹,就像winrar或者winzip一样 如何生成一个曲线图?
TIME:为表中的字段。
用fupip(小贝) 的方法可以。谢谢。
我还想问一下,我从datagrid中单击,改变textBox.text的值时有时为什么对应的值不对呀。
System.Windows.Forms.DataGrid.HitTestInfo hti;
hti = this.dataGrid1.HitTest(e.X, e.Y);
if (hti.Type==System.Windows.Forms.DataGrid.HitTestType.Cell)
{
textBox1.Text=dataset.Tables[0].Rows[hti.Row][0].ToString();
textBox1.Text=dataset.Tables[0].Rows[hti.Row][1].ToString();
dateTimePicker1.Value=System.DateTime.Parse(dataset.Tables[0].Rows[hti.Row][2].ToString().Trim());
comboBox1.Text =dataset.Tables[0].Rows[hti.Row][3].ToString();
textBox8.Text=dataset.Tables[0].Rows[hti.Row][4].ToString();
textBox3.Text=dataset.Tables[0].Rows[hti.Row][5].ToString();
textBox4.Text=dataset.Tables[0].Rows[hti.Row][6].ToString();
textBox5.Text=dataset.Tables[0].Rows[hti.Row][7].ToString();
textBox6.Text=dataset.Tables[0].Rows[hti.Row][8].ToString();
textBox7.Text=dataset.Tables[0].Rows[hti.Row][9].ToString();
}