摘要: public static DataTable SelectSqlReturnTable(string sql, CommandType type, SqlParameter[] pars) { SqlConnection con = new SqlConnection(ConnString); SqlDataAdapter sda = new SqlDataAdapter(sql, con); sda.SelectCommand.CommandType = type; if (pars != nul... 阅读全文
posted @ 2012-07-19 16:53 net小伙 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 存储过程:-- =============================================-- Author: netboy-- Create date: 2012年7月18日-- Description: 通过cid得到用户一级密码-- =============================================CREATE PROC [dbo].[GETONEPED] @C_ID nvarchar(50), @onepwd nvarchar(50) outputASBEGIN select @onepwd = C_OneP... 阅读全文
posted @ 2012-07-19 16:42 net小伙 阅读(4643) 评论(0) 推荐(1) 编辑
摘要: 带参数的SqlDataAdapter : using (SqlConnection con = new SqlConnection("server=.; database=data; integrated security=SSPI;")) { using (SqlCommand com = con.CreateCommand()) { com.CommandText = "select Age from T_User where UserName=@n... 阅读全文
posted @ 2012-07-19 08:58 net小伙 阅读(550) 评论(0) 推荐(0) 编辑