public DataTable executeProc(string name, string parameters = "", Boolean open = false, char spliter = '@', char spliter2 = '#') { DataTable dt = new DataTable(); try { using (SqlConnection _sqlConnection = new SqlConnection(Configs._urlServer)) { _command = new SqlCommand(); _command.CommandType = CommandType.StoredProcedure; _command.Connection = _sqlConnection; _command.CommandText = name; string[] prm = parameters.Split(spliter2); if (parameters != "") { for (int i = 0; i < prm.Length; i++) { string[] valPrm = prm[i].Split(spliter); if (valPrm[1] == "date") { if (valPrm[2] == "") { _command.Parameters.Add("@" + valPrm[0], SqlDbType.DateTime).Value = DBNull.Value; } else { _command.Parameters.Add("@" + valPrm[0], SqlDbType.DateTime).Value = Convert.ToDateTime(valPrm[2]); } } else if (valPrm[1] == "string") { _command.Parameters.Add("@" + valPrm[0], SqlDbType.NVarChar).Value = valPrm[2]; } else if (valPrm[1] == "int") { if (valPrm[2].Trim() == "") { valPrm[2] = "0"; } _command.Parameters.Add("@" + valPrm[0], SqlDbType.BigInt).Value = valPrm[2]; } else if (valPrm[1] == "double" || valPrm[1] == "float") { if (valPrm[2].Trim() == "") { valPrm[2] = "0"; } _command.Parameters.Add("@" + valPrm[0], SqlDbType.Float).Value = MCV.MyConvert.ToDouble(valPrm[2]); } } } _dataAdapter = new SqlDataAdapter(_command); _dataAdapter.Fill(dt); } } catch (Exception exx) { Configs.Debug(exx, "Omniyat.Models.Query.executeProc", name + " => " + parameters); } return(dt); }