hello everyone still now i m working in c# window application and now im working in asp.net
i made a same form and same coding in window application but this code is not working in asp.net...
i want to do here is:
member_id textbox
when i put some data in textbox i show the data in the label as(how many books a person have..)
my code is:

SqlConnection cs = new SqlConnection("Data Source=IRIS-CSG-174;Initial Catalog=library_system;Integrated Security=True");
cs.Open();
SqlCommand cmd = new SqlCommand("SELECT COUNT(1) as member_id FROM lib_issue_details WHERE member_id='" +TxtboxmemberId.Text + "'", cs);

SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
DataSet ds = new DataSet();
da.Fill(ds, "lib_issue_details");

Label2.DataBindings.Clear();
Label2.DataBindings.Add(new Binding("text", ds, "lib_issue_details.member_id"));

my last two lines of databinding is not working..
plzz help me regarding my code and correct it

Recommended Answers

All 3 Replies

label2.text=ds.Tables[0].Rows[0]["YourIntegerColumn"].ToString();

label.text = ds.tables[0].rows[0].["columnname"]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.