bal
public DataSet Fetch()
{
edal.connection();
edal.sc.Open();
ds = edal.Fill();
edal.sc.Close();
return ds;
}
dal
public DataSet Fill()
{
SqlDataAdapter da = new SqlDataAdapter("masteriud", sc);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
da.SelectCommand.Parameters.Add(new SqlParameter("@flag", SqlDbType.Int));
da.SelectCommand.Parameters["@flag"].Value = 2;
ds = new DataSet();
da.Fill(ds);
return ds;
}
ui
public void fill()
{
ds = ebal.Fetch();
GridView1.DataSource = ds;
GridView1.DataBind();
}
Error - Procedure or Function 'masteriud' expects parameter '@Id', which was not supplied.
i dont want to use any parameter i just want to show data on page load using flag
my store procedure goes like this
alter procedure masteriud(@Id int,@Name varchar(50),@Address varchar(50),@flag int)
as
begin
if @flag='1'
begin
insert into Memployee(Id,Name,Address)values(@Id,@Name,@Address)
end
if @flag='2'
begin
select * from Memployee
end
Please help me out in this coding
Thanks!!! :)