存储过程的应用+数据库 SqlParameter[] pr ={new SqlParameter("@name",SqlDbType.VarChar,50) ,new SqlParameter("@pwd",SqlDbType.VarChar,50)}; pr[0].Value = name; pr[1].Value = pwd; using (SqlConnection con = new SqlConnection("server=.uid=sa;pwd=sa;database=pubs")) { using (SqlCommand com = new SqlCommand()) { com.Connection = con; com.CommandType = CommandType.StoredProcedure; com.CommandText = "proc_insert"; con.Open(); foreach (SqlParameter prs in pr) { com.Parameters.Add(prs); } object obj = com.ExecuteScalar(); if (obj != null) return Convert.ToInt32(obj.ToString()); else return 0; } }
- 1
- 粉丝: 12
- 资源: 2
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助