Featured Links

What is the best ASP.NET SQL data retrieval method to learn?

If I am looking to work as an ASP.NET developer, what technology should I learn to retrieve data from a SQL server? ADO.NET? Linq? The SqlDataSource object? Which is necessary?

4 Responses to “What is the best ASP.NET SQL data retrieval method to learn?”

  • chengfee.Zvet:

    Hi, I’m using SqlDataAdapter with DataSet instead of SqlDataSource. Both of them work similarly but I just get very used with SqlDataAdapter with DataSet. For instance:

    Dim da as SqlDataAdapter = New SqlDataAdapter("Select * from Table1", connectionString)

    Dim ds as new DataSet( )

    da.Fill(ds, "Table1")

    variable1 = da.Tables("Table1").Rows(0).Item("ID")

    As easy as 1, 2, 3 :)

  • Ratchetr:

    You should probably be at least familiar with all 3. Not an expert, but at least a basic understanding.

    My personal preference is LINQ. What I like about it is that it extends well beyond just SQL. Linq for SQL, Linq for entities, Linq for XML, Linq for datasets..etc, etc, etc. I like working with something that provides such a broad abstraction.

  • Skylar:

    I also suggest Linq :)

  • dhvrm:

    LINQ is a query language. In and of itself, it cannot be used to retrieve data.

    ADO.NET is a framework that contains a number of namespaces and classes used to work with data. There is no practical reason behind "learning ADO.NET," since it has many, many parts, much of which isn’t applicable to SQL Server.

    SqlDataSource is a control, not a technology. It leverages the ADO.NET framework. Its primary benefit is its near-total abstraction of the process of getting information into and out of a SQL Server database.

    Generally speaking, when you want to get data from SQL Server in ASP.NET, you can use the SqlDataSource control. You can also use the System.Data.SqlClient namespace to programmatically work with a SQL Server. Most people would probably find the SqlDataSource control easiest to learn and use.

    http://www.asp.net/learn/data-access/

Leave a Reply

You must be logged in to post a comment.