using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.OleDb; using System.Data; public partial class Retrive_Data_From_Database_and_display_in_TextBox : System.Web.UI.Page { OleDbConnection con; OleDbCommand com; OleDbDataAdapter da; DataSet ds; protected void Page_Load(object sender, EventArgs e) { con = new System.Data.OleDb.OleDbConnection(); ds = new DataSet(); con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/kamnagroup.mdb") + ""; string sql = "select aname,add1,photo,point from joining WHERE point=(SELECT MAX(point) FROM joining)"; da = new System.Data.OleDb.OleDbDataAdapter(sql,con); con.Open(); da.Fill(ds,"joining"); navigatedata(); con.Close(); con.Dispose(); } private void navigatedata() { DataRow dRow=ds.Tables["joining"].Rows[0]; TextBox1.Text = dRow.ItemArray.GetValue(0).ToString(); TextBox2.Text = dRow.ItemArray.GetValue(1).ToString(); TextBox3.Text = dRow.ItemArray.GetValue(2).ToString(); TextBox4.Text = dRow.ItemArray.GetValue(3).ToString(); Image1.ImageUrl = TextBox3.Text; } }
Image1.ImageUrl = dRow.ItemArray.GetValue(2).ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)