c# - [WebMethod] -exec stored procedure - return bool value from web service



[WebMethod]
public bool Fn_SpCalistirBool(string p_kod45,string kullanici, string sifre, string spName)
{
if (Fn_SifreKontrol(p_kod45,kullanici, sifre) == false) { return false; }//auth. control
Baglanti();//checking database connection

pr_AdapterSql.SelectCommand.Connection = pr_Cnn;
pr_AdapterSql.SelectCommand.CommandText = spName;
pr_AdapterSql.SelectCommand.CommandType = CommandType.StoredProcedure;
pr_AdapterSql.SelectCommand.Parameters.Clear();

try
{
if (pr_AdapterSql.SelectCommand.Connection.State == ConnectionState.Closed)
{ pr_AdapterSql.SelectCommand.Connection.Open(); }
pr_AdapterSql.SelectCommand.ExecuteReader();
}
catch (Exception) { return false; }
return true;
}

Yorumlar