Results 1 to 3 of 3

Thread: Connecting to SQL Server

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2009
    Location
    Milan
    Posts
    810

    Connecting to SQL Server

    A couple of questions. Can you connect to a SQL Server in ASP.NET?

    If so how?

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: Connecting to SQL Server


  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Connecting to SQL Server

    Question 1: Yes.

    Question 2: It depends

    Out of the box, ASP.Net ships with a number of controls that allow you to directly bind your UI elements to a SQL Server Database. This is done using a server control called SqlDataSource. This control is fine for getting started, but for the longer term, it really isn't recommended.

    Instead, you should be looking to use ADO.Net, using classes like SqlConnection, SqlCommand, etc. For information on how to do this, check out the ADO.Net links in my signature.

    There are also, other newer ways of doing this, using things like LINQ to SQL and the Entity Framework.

    If you provide more information about what exactly you are trying to achieve then the best course of action can be recommended.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width