I have created table in sqllite database and i want to retrieve that table data and it must be displayed in html page, in html page i have to write connection string in javascript and get the table data .
I am a fresher please help me iam loosing my confidence and please tell how to solve this task....
Reguards,
chv.sriram
Loading
Jiteendra SampathiraoPosted Jul 16, 2011, 1:04 AM
Create html form.And place asp label controls.
ANd retrieve the values from database Like this:
string selectquery = "";
selectquery = "select RID, UserName, Email_Id, CONVERT(varchar, DOB, 103) AS DOB, CONVERT(varchar, DOJ, 103) AS DOJ, State, Pin_Code FROM Registration where RID=" + hdnvalue;
SqlConnection sqlcon = new SqlConnection(ConfigurationManager.AppSettings["SqlServer"]);
SqlCommand sqlcomm = new SqlCommand();
sqlcomm = sqlcon.CreateCommand();
sqlcomm.CommandType = CommandType.Text;
sqlcomm.CommandText = selectquery;
sqlcon.Open();
SqlDataReader sqlred = null;
sqlred = sqlcomm.ExecuteReader();
if (sqlred.Read())
{
if (sqlred["UserName"] != null)
{
Label1.Text = sqlred["UserName"].ToString();
}
if (sqlred["Email_Id"] != null)
{
Label2.Text = sqlred["Email_Id"].ToString();
}
if (sqlred["DOB"] != null)
{
Label3.Text = sqlred["DOB"].ToString();
}
if (sqlred["DOJ"] != null)
{
Label4.Text = sqlred["DOJ"].ToString();
}
}
sqlcomm.Dispose();
sqlcon.Close();
finally redirect to this html form page...
server.transfer("htmlcontent.aspx");
I hope it help you......