我在 C# 控制台应用程序中执行我的存储过程时遇到问题,我不知道问题是什么。你能看一下吗?
string path="";
StringBuilder sb = new StringBuilder();
StringBuilder sqlErrorMessages = new StringBuilder("Sql Exception:\n");
try
{
SqlConnection conn = new SqlConnection("Data Source=DESKTOP-M3IMRLE\\SQLEXPRESS; Initial Catalog = db2; Integrated security=true");
Console.WriteLine("Enter path : ");
path = Console.ReadLine();
conn.Open();
SqlCommand cmd = new SqlCommand();
SqlCommand command = new SqlCommand("EXECUTE main.mainproc @path='" + path + "'", conn);
if(command!=null)
{
Console.WriteLine("JSON loaded");
}
conn.Close();
}
catch(SqlException ex)
{
sqlErrorMessages.AppendFormat("Message: {0}\n", ex.Message);
}
慕码人8056858
相关分类