namespace Practice1 { public partial class StdInfo : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } public void Binddata() { string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; using (SqlConnection con=new SqlConnection(CS)) { con.Open(); SqlCommand cmd=new SqlCommand("select * from tab",con); cmd.ExecuteNonQuery(); INFO.DataSource = cmd.ExecuteReader(); INFO.DataBind(); } } I am getting error Object reference not set to an instance of an object. on INFO.DataSource = cmd.ExecuteReader(); i am trying to call Bindadata method from other webpage help me friends am beginner to asp.net
using
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)