.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Code Snippets >> ASP.NET Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

SQLDatasource in asp.net

Posted By:Narayanan       Posted Date: October 31, 2011    Points: 40    Category: ASP.NET Controls    URL: http://www.dotnetspark.com  

Now, we discuss about how to use the SQLDataSource using in asp.Net .I explain the step by step processing of using SQLDatasource in ASP.Net

  Today, we will discuss about the "How to use SQLDataSource in ASP.Net Project?"

Create a ASP.net Web Page using Microsift Visual Web developer.

    you could view the APP_Data,Default.aspx and Web.config.Now , you could view the Design and Source portion.In Source Portion you could view this code...

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

    Untitled Page



Create a database and table for asp.Net.

Click "Add New Item" and select SQL Server Database" and Create a table on the Database For Example: "testing.mdf"
using SQLDatasource.Now, you click the SQLDatasource in the Toolbox and Click ">" button and Create a Configure Data Source.Please follow the following instruction

1) Click "New Connection String"
2) Click "Change Button" and Select" Microsoft Sql Server Database File"  in the List.
3)Click "ok" Button.
4) Now click "Browser" and select a database as already you create (testing.mdf)
5) Click Test Connection
6) Click "Ok"
7) Click "Next"
8) Click "Next"
9) Click "Finish"

Now you could access the SQLDatasource in ASP.net.In my article, I will explain with example.


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend