using system;
using system. data;
using system. configuration;
using system. web;
using system. web. security;
using system. web. ui;
using system. web. UI. webcontrols;
using system. web. UI. webcontrols. webparts;
using system. web. UI. htmlcontrols;
using system. data. sqlclient; // import the namespace by yourself.
Public partial class _ default: system. web. UI. page
{
private string voteid = "1";
protected void page_load (Object sender, eventargs e)
{< br> sqlconnection con = dB. createconnection ();
con. open ();
sqlcommand cmd = new sqlcommand ("select votetitle from votemaster where voteid =" + this. voteid, con); // This. voteid = 1 variable on this page
String title = convert. tostring (CMD. executescalar (); // returns the first column of the First row.
This. lbltitle. TEXT = title;
sqlcommand detail item = new sqlcommand ("select votedetailsid, voteitem from votedetails where voteid =" + this. voteid, con);
sqldatareader SDR = custom item. executereader (); // return the query result
This. rbtnitems. datatextfield = "voteitem";
This. rbtnitems. datavaluefield = "votedetailsid";
This. rbtnitems. datasource = SDR;
This. rbtnitems. databind ();
SDR. Close ();
// Con. Close ();
}
Protected void rbtnitems_selectedindexchanged (Object sender, eventargs E)
{
}
Protected void btnvote_click (Object sender, eventargs E)
{
// Sqlconnection con = d
}
}