【发布时间】:2015-02-19 23:20:35
【问题描述】:
我想添加一个新行:
SqlDataAdapter da = new SqlDataAdapter("select time from foglalas", c1);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
DataSet ds = new DataSet();
da.Fill(ds, "fog");
DataRow uj = ds.Tables["fog"].NewRow();
组合框值 12:00
我有一个组合框,我想使用 combobox data==slq 查询结果确保尚未添加行
我该怎么做?
【问题讨论】:
-
不太清楚你在问什么。您想查找您的
ds中是否有“12:00”吗?如果是这样 - 它已经被问到 - stackoverflow.com/questions/16366297/…。如果不是这种情况 - 请考虑用其他方式提出您的问题。 -
我有一个包含时间格式(1:00,2:00 ....etc)的组合框,在数据库中,我正在节省时间格式(1:00,2:00.. ..23:00)并且由于冗余,我不想添加相同的时间,我如何检查 2 个数据(在数据库和组合框之间)。对不起我的英语不好。
-
所以在插入之前检查您的数据集,在
Select的帮助下插入,就像我之前的链接一样。那样有用吗?还有foglalas中time列的数据类型是什么? -
foglalas 的时间是 nvarchar。很难比较 2 个文本,我不明白我该怎么做,你链接的内容,我认为对我的问题不利
-
我已经尝试解释如何使用
Select作为答案。
标签: c# sql-server wpf time dataset