Last post Aug 22, 2017 04:15 PM by Enzyme
Aug 22, 2017 11:55 AM|Enzyme|LINK
Friends, can anyone help me check if what I did here is right.
I have a button that when it is clicked it will fetch data from data table and display on a datalist, but when I click the button it does not fire.
below is what I did:
protected void Button1_Click(object sender, EventArgs e)
public void bind1()
if (!object.Equals(Session["UserId"], null))
string connetionString = null;
connetionString = (@"Data Source=My_DB;Integrated Security=False;");
con = new SqlConnection(connetionString);
using (SqlCommand sqlCmd = new SqlCommand("SELECT TOP (1) Name, Age FROM Table1 ORDER BY NEWID()", con))
DataTable dt = new DataTable();
DataList1.DataSource = dt;
Aug 22, 2017 04:15 PM|Enzyme|LINK
Good a thine, I got it right at last.
and it worked