20 August 2012

SQLDatasource in asp.net

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" %>
    <title>Untitled Page</title>
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.

No comments: