Load database data into asp.net page -
i know how load data database asp.net form.
so use code data via query "select * ... ... = ...
"
then load reader ,
while (reader.read) { string sproductname = convert.tostring(reader[1]); /* need display name , other data (selling price, etc) on form not know how many products there (the form) has change database information (more products added or removed). */ }
i not know how last part. how make data found display on screen.
thanks !
the data need display product name, product description , product selling price underneath headings names thats all.
for sql database,
take gridview control id="gridview1" (whatever use same id in code)
sqlconnection sql= new sqlconnection("your data base connection"); sqlcommand cmd = new sqlcommand("select * your_table_name", sql); sqldataadapter da = new sqldataadapter(cmd); dataset ds = new dataset(); da.fill(ds); gridview1.datasource = ds; gridview1.databind();
Comments
Post a Comment