我在 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);}
- 2 回答
- 0 關注
- 194 瀏覽
添加回答
舉報
0/150
提交
取消
