public class Candidate { public int CandidateId {get;set;} public string CName { get; set; } public string CFName { get; set; } public string CMName { get; set; } public string CSex { get; set; } public string CLanguageknown { get; set; } public DateTime CDob { get; set; } public DataTable getcandidate() { SqlConnection con = new SqlConnection(@"Data Source=KALAISELVAN\SQLEXPRESS;Initial Catalog=Applicant;Integrated Security=True"); SqlCommand cmd = new SqlCommand("select * from candidate", con); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); return dt; }
private void Form1_Load(object sender, EventArgs e) { Candidate cand = new Candidate(); cand.getcandidate(); }
GridView1.DataSource = cand.getcandidate(); GridView1.DataBind();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)