Beginner :: Need help to bind the data in GridView using asp standard controls

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Riaaaa
    New Member
    • Mar 2007
    • 16

    Beginner :: Need help to bind the data in GridView using asp standard controls

    I m beginner for ASP.Net 2005 with C# and SQL Server 2005.

    I have created the form which contains many asp standard controls on it like label,textbox,c heckbox,dropdow nlist,command button.
    The command button used are only to execute the different queries on click event.
    I have put the GridView control which is used to show the database stored related to that form.
    I m using SQL DataSource control for the connection.

    Now,my problem is i m not able to write the proper SQL queries which insert,delete,u pdate or select from the GridView and Standard Controls.

    In short,I have a command button set up on a form to run a SQL pass-through insert query after several field are filled in standard controls but I can't get .Please anyone could help me to provide the sample source code related to above controls used in the same form.

    Thanxs

  • Riaaaa
    New Member
    • Mar 2007
    • 16

    #2
    Please help me with some sample source code i m really in urgent need...
    Want to create the project thenafter.

    <asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
    ConnectionStrin g="<%$ ConnectionStrin gs:companymaste r %>"
    DeleteCommand=" DELETE FROM [Categories]
    WHERE [CategoryID] = @CategoryID"
    InsertCommand=" INSERT INTO [Categories]
    ([CategoryName], [Description])
    VALUES (@CategoryName, @Description)"
    UpdateCommand=" UPDATE [Categories] SET
    [CategoryName] = @CategoryName,
    [Description] = @Description
    WHERE [CategoryID] = @CategoryID">
    </asp:SqlDataSour ce>
    <asp:GridView ID="GridView1" runat="server"/>

    I have used the above code for the sql queries with sqldatasource control and gridview control.
    Is any connection other than this required ??
    What should be written in web.config ??

    Pls provide proper guideline...

    Is the code enough to complete what i needed if it's incomplete then pls help out

    Comment

    • kenobewan
      Recognized Expert Specialist
      • Dec 2006
      • 4871

      #3
      Here is an article that may help:
      GridView

      Comment

      Working...