标签:data isp name cell exe rgs har c89 contract
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.Web.UI; 6 using System.Web.UI.WebControls; 7 using System.Data; 8 using System.Data.SqlClient; 9 using Aspose.Cells; 10 using System.Configuration; 11 12 public partial class _Default : System.Web.UI.Page 13 { 14 protected void Page_Load(object sender, EventArgs e) 15 { 16 string connectionString = ConfigurationManager.AppSettings["RenWen_DBConnectionString"]; 17 SqlConnection connection = new SqlConnection(connectionString); 18 SqlDataReader returnReader; 19 connection.Open(); 20 #region 21 SqlParameter[] parameters = { 22 new SqlParameter("@IdentityCard", SqlDbType.NVarChar,18), 23 new SqlParameter("@Name", SqlDbType.NVarChar,20), 24 new SqlParameter("@birthday", SqlDbType.NVarChar,20) 25 }; 26 27 parameters[0].Value =""; 28 29 #endregion 30 SqlCommand command =new SqlCommand(); 31 command.CommandTimeout = 600; 32 command.CommandType = CommandType.StoredProcedure; 33 foreach (SqlParameter parameter in parameters) 34 { 35 if (parameter != null) 36 { 37 // 检查未分配值的输出参数,将其分配以DBNull.Value. 38 if ((parameter.Direction == ParameterDirection.InputOutput || parameter.Direction == ParameterDirection.Input) && 39 (parameter.Value == null)) 40 { 41 parameter.Value = DBNull.Value; 42 } 43 command.Parameters.Add(parameter); 44 } 45 } 46 returnReader = command.ExecuteReader(CommandBehavior.CloseConnection); 47 connection.Close(); 48 } 49 50 }
http://www.cnblogs.com/knowledgesea/archive/2013/01/02/2841588.html
标签:data isp name cell exe rgs har c89 contract
原文地址:http://www.cnblogs.com/wangsen123/p/6596051.html