in

Chennai .Net User Group

A platform that enables you to Learn, Share & Grow (India's first .Net user group)
Latest post 06-17-2010 1:48 PM by Balaguru. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-04-2008 12:18 PM

    • karthika
    • Top 25 Contributor
    • Joined on 12-04-2008
    • Posts 3
    • Points 70

    How to get data from the database using c# coding?

    Hi,

     I am developing website using C# language in asp.net. I dont know how to write coding to get data from relevant database.

    Please help me to develop it.

     

    Thanks & Regards

    Karthika

    Filed under:
  • 12-06-2008 2:23 PM In reply to

    Re: How to get data from the database using c# coding?

    Answer

    There are numerous solutions to solve your problem.

    1. Use a Datagrid control and provide it with relavent DataSource.

    This is just one that comes to my mind imm as it doesnt involve any code.

     

    Link: http://www.codersource.net/asp_net_gridviewcontrol.aspx

     

    This is a very useful that will solve your problem.

     

    Thanks.

    Sriram Narasimhan

    Microsoft Student Partner

    HIndustan University

    Email: sriramnh@gmail.com

    Mobile: +919884280854

    I blog @ http://sriramnh.spaces.live.com

  • 05-12-2010 3:54 PM In reply to

    Re: How to get data from the database using c# coding?

    Hi,I am already published website ,for that used this http://www.thewebpole.com/  site's domain name and hosting site,here provide use friendly service  for my website creating help,so easily i launch my website,you may also try for this site ,it is really best in all the ways.All the best for your Website.

  • 06-17-2010 1:48 PM In reply to

    • Balaguru
    • Top 50 Contributor
      Male
    • Joined on 06-17-2010
    • Chennai
    • Posts 2
    • Points 5

    Re: How to get data from the database using c# coding?

    hi karthika,

            using System;
            using System.Data.SqlClient;

            SqlConnection Conn = new SqlConnection("Server=(local);Database=Employee;User ID=sa;Password=password");
            Conn.Open();
            SqlCommand comm=new SqlCommand("insert tblEmployeeDetails(EmployeeID,Name,Address,Contact) values('"+TxtID.Text+"','"+TxtName.Text+"','"+TxtAddr.Text+"','"+TxtContact.Text+"')",Conn);
            comm.ExecuteNonQuery();
            Conn.Close();

     

     

    This is single tier.. but three tier is best one for  develping project..

     

    by,

    bala

Page 1 of 1 (4 items)
Copyright © 2002-2008 Chennai .Net User Group. All Rights Reserved. Microsoft and Microsoft logo's are trademarks of Microsoft Corporation