데이터 유형이 날짜 시간 인 저장소 콤보 상자에 null을 넣을 수 있습니까? 또는 날짜 시간을 null로 변환해야합니까? 내가이 코드를 삽입하려고 그것은 나를 오류 줄저장소에 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);
}
}
}
}
오류가 내가 원하는 것은 경우, 필터를 얻는 것입니다 다른 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();
}
결론에 선택 쿼리에 catch
했다 로그 아웃이 비어 있거나 null입니다. image that i want
오류 메시지의 내용을 게시 할 수 있습니까? 그것은 아마도 repo 개체와 아무 관련이있을 수 있지만 오히려 당신이 null을 취사 아니에요 SqlParameteres – TheDanMan
eem, 당신은 링크 이미지를 확인 해 봤어? 나는 그것을 엄지 손톱으로 만드는 방법을 모른다. 네, 저장소와 아무런 관련이 없습니다. – chopperfield