public void detail_bind(DetailView dv, string query)
{
ds.Clear();
cmd.CommandText = query;
adp.Fill(ds, "vtt");
dv.DataSource = ds.Tables["vtt"];
dv.DataBind();
}
}
// How to call this global function in managecourse.aspx.cs file //
public partial class managecourse : System.Web.UI.Page
{
connection c = new connection();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
c.detail_bind(DetailView1, "select * from student where sid='"+Session["sname"].ToString()+"'");
}
}
}
No comments:
Post a Comment