I am new to programming and please tell me how to get a column value retrieved from MS Sql database to a label. I hav got the data from sql as follows
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ShopsConnectionStringM"].ConnectionString);
con.Open();
sda = new SqlDataAdapter("Select UserName,Email,ShopCountry,PIN,ShopName,ShopCity,ShopDistrict,ShopState, Location,ShopBoard from Shops_Table where UserName= '" + HiddenField1.Value + "'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
now i have an asp .net label
<asp:Label ID="Label5" runat="server" Text="Label"></asp:Label>
How do i get the value of column "Email" to Label5 ?
is it possible to do like this?
<asp:Label ID="Label5" runat="server" Text='<%#Eval("Email")%>'></asp:Label>
I dont want to use code behind or c#.
Please help.