我正在尝试使用Git - Extension与同事一起使用C#编写的应用程序.
我们已经在文件.gitignore上添加了文件"project1.suo",但每当我们中的一个人必须提交项目时,Git似乎告诉我们提交文件"project1.suo".
我们尝试了很多方法在.gitignore中添加文件:
*.suo
project1.suo
c:\project\project1.suo
Run Code Online (Sandbox Code Playgroud)
我们无法解决这个问题.
我的代码中有一个例外.我已经尝试将我的int64更改为int32,但这并没有改变它.
在数据库中,表示"column_ID"的单元格具有数据类型NUMBER.
问题出在此代码的第7行:
private void dataGridView_ArticleINVIA_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0 && e.RowIndex <= (sender as DataGridView).Rows.Count - 1)
{
try
{
Int64 id_riga = Convert.ToInt64((sender as DataGridView).Rows[e.RowIndex].Cells["column_ID"].Value);
//Exception thrown here:
int id_macchina = Convert.ToInt32((sender as
DataGridView).Rows[e.RowIndex].Cells["column_Machine"].Value);
FormRecipeNote PopUpNote = new FormRecipeNote(id_macchina,
"MODIFICA", id_riga, 0);
PopUpNote.ShowDialog(this);
PopUpNote.Dispose();
}
catch (Exception Exc)
{
FormMain.loggerSoftwareClient.Trace(this.Name + " " + Exc);
}
//DataGrid_ArticleINVIA();
}
}
Run Code Online (Sandbox Code Playgroud)
错误是:
System.InvalidCastException: Object cannot be cast from DBNull to other types.
at System.DBNull.System.IConvertible.ToInt64(IFormatProvider provider)
at …Run Code Online (Sandbox Code Playgroud)