【发布时间】:2016-09-01 07:21:11
【问题描述】:
如何在数据类型为日期时间的存储库组合框上放置一个空值? 还是我应该将日期时间转换为 null ? 我试着把这段代码给我错误
public void store()
{
GridView view = sender as GridView;
for (int i = 0; i < gridView1.RowCount; i++)
{
if (gridView1.GetDataRow(i)["signOut"] == DBNull.Value)
{
DateTime? px = null;
if (!repositoryItemComboBox10.Items.Contains(px))
{
repositoryItemComboBox10.Items.Add(px);
}
}
}
}
错误是catch 在其他method 中的选择查询
public void SDB()
{
SqlDataAdapter adapter2 = new SqlDataAdapter(command.CommandText, myConnection);
try
{
ds2.Clear();
dt2.Clear();
command2.Connection = myConnection;
command2.CommandText = " ..."
adapter2.SelectCommand = command2;
adapter2.Fill(ds2);
adapter2.Fill(dt2);
gridControl1.DataSource = dt2;
myConnection.Open();
}
catch (Exception ex)
{
MessageBox.Show("error" + ex);
}
finally
{
myConnection.Close();
}
结论我想要的是得到过滤器,如果注销是空白或空 image that i want
【问题讨论】:
-
你能发布错误信息是什么吗?它可能与 repo 对象无关,而是您不适合 null SqlParameteres
-
eem,你检查链接图片了吗?我不知道如何使它成为一个拇指指甲。是的,与存储库无关。
标签: c# winforms devexpress