protected void btnnextpersdetls_Click(object sender, EventArgs e) { SqlParameter[] _params = { new SqlParameter("@UserName","kotlanaveen23@gmail.com"),new SqlParameter("@password","xswqaz")}; DataSet ds1 = new DataSet(); ds1 = objl.fnExecuteDataSet("hrrec", "T", "sp_GetEmpPersonalDetails", _params); } service method public DataSet fnExecuteDataSet(string schema, string connect_Test_or_Production, string p, params SqlParameter[] Parameters) { // throw new NotImplementedException(); try { if (fnOpenConnection(schema, connect_Test_or_Production) == true) { _objDataSet = new DataSet(); _objSqlDataAdapter = new SqlDataAdapter(); _objSQLCommand = new SqlCommand(); _objSQLCommand.Connection = _objSQLConnection; _objSQLCommand.CommandType = CommandType.StoredProcedure; _objSQLCommand.CommandText = p; foreach (SqlParameter objParamaeter in Parameters) { _objSQLCommand.Parameters.Add(objParamaeter); } _objSqlDataAdapter.SelectCommand = _objSQLCommand; _objSqlDataAdapter.Fill(_objDataSet); return _objDataSet; } else { return null; } } catch (SqlException dbEx) { return null; } catch (Exception ex) { return null; } finally { _objDataSet = null; _objSqlDataAdapter = null; _objSQLCommand = null; fnCloseConnection(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)