ببین این مدل کدنویسی رو دیگه فراموش کنید بجاش بیاید از پارامترها استفاده کنید:
string strConn = "Data Source = .\\SQLExpress; Initial Catalog = Northwind; Integrated Security = True"; SqlConnection _sql_connection = new SqlConnection(strConn); SqlCommand _sql_command = new SqlCommand("GetDetenions", _sql_connection); _sql_command.CommandType = CommandType.StoredProcedure; SqlParameter param_DATE = _sql_command.Parameters.Add("@_date", SqlDbType.DateTime); DateTime dt = new DateTime(2010,10,11); param_DATE.Value = dt; //dt is a DateTime type defined earlier in C# DataTable data_table = new DataTable(); SqlDataAdapter sql_adapter = new SqlDataAdapter(_sql_command); sql_adapter.Fill(data_table);