组合框选择的值未使用c#在数据库中正确存储 [英] Combo box Selected value is not stored properly in Database using c#
本文介绍了组合框选择的值未使用c#在数据库中正确存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Windows应用程序,其中我将组合框选择值保存到数据库。我编写的代码如下: -
I am working on windows application, in which I am saving combo box selected value to database. I wrote the code as follows:-
slc.Parameters["@Cust_Name"].Value = cmbCust_Name.SelectedValue.ToString();
cmbCust_Name是组合框的名称。当我将数据保存到数据库时,保存System.Data.DataRowView而不是实际数据。
任何帮助??
在此先感谢!!!
cmbCust_Name is the name of combo box. when I am saving the data to the database, System.Data.DataRowView is saved instead of actual data.
Any Help ??
Thanks In Advance !!!
推荐答案
对网页不了解但在网上
我们喜欢(查询插入到emp(状态)值(@a))
slc.parameters.add(@ a,sqldbtype.varchar,100).value = dropdownlist1.selecteditem。 text;
don''t have idea about windows but in web
we do like(Query-insert into emp(state) values(@a))
slc.parameters.add("@a",sqldbtype.varchar,100).value=dropdownlist1.selecteditem.text;
http ://social.msdn.microsoft.com/Forums/is/sqlgetstarted/thread/9881f691-daa5-48b1-8e17-af52148c8d2f [ ^ ]
如何将数据从组合框插入到sql数据库在连接模式下? [ ^ ]
这篇关于组合框选择的值未使用c#在数据库中正确存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文