Results 1 to 5 of 5

Thread: need sugesstion to do connection of sql in asp.net

  1. #1
    Join Date
    Jul 2010
    Posts
    75

    need sugesstion to do connection of sql in asp.net

    I need a help guys, i want to connect my sql database in ASP.net. I had connected microsoft access in java and other language but i hav'nt connected sql in .net technology.I want to use my frontend as ASP.net and backend as sql, please help.

  2. #2
    Join Date
    Jan 2008
    Posts
    644

    Re: need sugesstion to do connection of sql in asp.net

    you have to create a new ASP .NET Web Application and name it 'SQLConnection'.Do a ctrl+alt+s shortcut that brings a server explorer window.>browse through
    server>yourcomputername>SQLservers>yourinstancename.
    click SQL server Instance if you cannot see the instance name right . Leave the default text in the field and new instance will be created using your comptuer name.Now we can connect to MyDB using different authentication. Click right to the database name and choose 'change Login'. uncheck the box "windows NT integrated security" and in the login field enter the login that we created first and choose your password.These are all steps through which you can create a connection.

  3. #3
    Join Date
    May 2008
    Posts
    518

    Re: need sugesstion to do connection of sql in asp.net

    You can connect your SQL server using SQL authentication in ASP.net. There are few steps through which you can connect your sql in asp.net. To create a secure communication follow the steps:
    1) Configuring a connection string.
    2) Encrypt the connection string.
    3) Configure sql server security.
    4) Test security access.
    5) secure the communication channel to the database.
    By following above steps you can create a connection.

  4. #4
    Join Date
    May 2008
    Posts
    271

    Re: need sugesstion to do connection of sql in asp.net

    You have to go through some steps for connectivity and you have to write some code for connection.You have to add a following code in your aspx.cs page.
    1) Add Namespace "using system.Data.SqlClient"
    2) Make sql connection.
    You have to write following code:
    SqlConnection con = new SqlConnection("Server= your server name or computer name;Database=yourdatabasename;Trusted_Connectopn=True");
    SqlCommand cmd = new SqlCommand("write your sql query here eg: select * from table name");
    con.Open();
    DataSet ds = new DataSet(cmd,con);
    SqlDataAdapter da = new SqlDataAdapter();
    da.Fill(ds);
    con.Close();
    Try to run this code, hope this work.

  5. #5
    Join Date
    May 2008
    Posts
    271

    Re: need sugesstion to do connection of sql in asp.net

    You have to go through some steps for connectivity and you have to write some code for connection.You have to add a following code in your aspx.cs page.
    1) Add Namespace "using system.Data.SqlClient"
    2) Make sql connection.
    You have to write following code:
    SqlConnection con = new SqlConnection("Server= your server name or computer name;Database=yourdatabasename;Trusted_Connectopn=True");
    SqlCommand cmd = new SqlCommand("write your sql query here eg: select * from table name");
    con.Open();
    DataSet ds = new DataSet(cmd,con);
    SqlDataAdapter da = new SqlDataAdapter();
    da.Fill(ds);
    con.Close();
    Try to run this code, hope this work.

Similar Threads

  1. Replies: 9
    Last Post: 14-05-2012, 05:35 PM
  2. Tips to optimize your Network Connection and Wireless Connection
    By Computer_Freak in forum Tips & Tweaks
    Replies: 3
    Last Post: 18-01-2012, 08:00 PM
  3. Replies: 1
    Last Post: 06-07-2011, 07:13 AM
  4. Create VPN connection results in Dial-up connection
    By Blerim in forum Windows Vista Network
    Replies: 3
    Last Post: 01-01-2010, 09:32 PM
  5. Replies: 5
    Last Post: 06-03-2009, 11:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,638,480,255.40602 seconds with 17 queries