当我运行代码以便将数据提交到我的数据库时。数据库的连接字符串是正确的。我已经为我的登录测试了它。
我收到此错误:
找不到存储过程'sp_insert'
SqlConnection con = new SqlConnection(@"Data Source = (IP); Persist Security Info = True; User ID = sa; Password = 1234");
SqlCommand cmd = new SqlCommand("sp_insert", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("username", textBox1.Text);
cmd.Parameters.AddWithValue("password", textBox2.Text);
cmd.Parameters.AddWithValue("email", textBox4.Text);
con.Open();
int i = cmd.ExecuteNonQuery();
con.Close();
答案 0 :(得分:1)
您必须在Initial Catalog=myDataBase
ConnectionString