悬赏园豆:10
[已解决问题]
解决于 2008-02-20 20:35
使用设计器编程数据集,再查询生成器,再执行查询,输入数据后,就可以录入到数据文件中。 <BR><BR>但是在编程中却不能实现。比如 <BR><BR>s_day = Convert.ToInt32(Convert.ToDateTime(dateTimePicker1.Value.ToString()).Day.ToString()); <BR>s_month = Convert.ToInt32(Convert.ToDateTime(dateTimePicker1.Value.ToString()).Month.ToString()); <BR>s_year = Convert.ToInt32(Convert.ToDateTime(dateTimePicker1.Value.ToString()).Year.ToString()); <BR>s_money = Convert.ToSingle(textBox2.Text); <BR>s_name = textBox1.Text; <BR>s_infromation = textBox4.Text; <BR>s_user = textBox3.Text; <BR>Database1DataSetTableAdapters.shang_money_moneyTableAdapter insert_ad = new WindowsApplication1.Database1DataSetTableAdapters.shang_money_moneyTableAdapter(); <BR>try <BR>{ <BR>insert_ad.Insert(s_money, s_year, s_month, s_day, s_user, s_name, s_infromation); <BR>} <BR>catch (Exception ee) <BR>{ <BR>textBox4.Text = ee.ToString(); <BR>} <BR><BR>可以运行,但是根本就无法插入数据!! 但是 单独的执行这个语句的时候是完全可以的 <BR>请求打人帮忙解决了