“(”附近有语法错误
private void button1_Click(object sender, EventArgs e)
{
if (filePath != null)
{
FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
Byte[] byte2 = new Byte[fs.Length];
fs.Read(byte2,0,Convert.ToInt32(fs.Length));
fs.Close();
DBHelper.connection.Open();
try
{
string sql = string.Format("INSERT INTO Im_Info(Pr_Info) VALUES (@Pr_Info)");
SqlCommand command = new SqlCommand(sql, DBHelper.connection);
SqlParameter par = new SqlParameter("@Pr_Info", SqlDbType.Image);
par.Value = byte2;
command.Parameters.Add(par);
int t = (int)(command.ExecuteNonQuery());
if (t > 0)
{
MessageBox.Show("储存成功!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
DBHelper.connection.Close();
}
}
}
在catch语句那里提示“(”附近有语法错误,无语了,怎么调也调不出来,本人是菜鸟,希望各位高手帮忙解决一下,感激不尽