Cybercrux

Everything is achievable through technology

STORE Procedure DAL

try
{

SqlCon=@”server=NEWVISION-PC\\SQLEXPRESS ;Integrated Security= True;database=Databasename;”
SqlConnection sqlC = new SqlConnection(SqlCon);

sqlC.Open();

SqlCommand sqlCom = new SqlCommand();
sqlCom.Connection = sqlC;
sqlCom.CommandType = CommandType.StoredProcedure;
sqlCom.CommandText = “SQL Query”;

sqlCom.Parameters.AddWithValue(“@OptionType”, OptionType);
sqlCom.Parameters.AddWithValue(“@Type”, Type);
sqlCom.Parameters.AddWithValue(“@param1”, param1);
sqlCom.Parameters.AddWithValue(“@param2”, param2);
sqlCom.Parameters.AddWithValue(“@param3”, param3);
sqlCom.Parameters.AddWithValue(“@param4”, param4);
sqlCom.Parameters.AddWithValue(“@param5”, param5);

SqlDataAdapter sqla = new SqlDataAdapter(sqlCom);
sqla.Fill(ds);
return ds;
}
catch (Exception ex)
{
throw ex;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s