locked
Beginner looking for a sample Asp.Net code... RRS feed

  • Question

  • User-356562709 posted

    Hi all,

    I am looking for an Asp.Net sample code which will access a SQL table (or stored procedure) and will list the fields in a Datagrid.
    In the Datagrid some fields would have Combo boxes so that the user can edit that field. I would also need options to DELETE and ADD new rows and SAVE button to save all the data back to SQL.

    One requirement would be to also (depending on user security) to prevent some rows from editing/deleting, etc...

    Today I am doing that in Coldfusion and is so easy but I am switching to Asp.Net so there is a learning curve, a big one.

    Thank you all.

    Max 

    Friday, June 25, 2010 2:42 PM

Answers

  • User-1460196090 posted

    Hello @maximusmd.

    Firstly, welcome to the ASP.NET side :) - I hope you will have fun while coding and using Microsoft latest Technologies.

    Here are bunch of video tutorials that can help you achive your requirements: http://www.asp.net/web-forms/data

    You can read the tutorial titles and find the appropriate one that will fit all your requirements.

    Mainly, in ASP.NET there is a GridView control (which you already know about it) which have a lot of built-in functionalities that can be used for Insert,Update,Delete functions with database. Please, take a look at the tutorials and give us a feedback.

    Thank you.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 25, 2010 2:49 PM
  • User-691245060 posted

    yes I watched those videos and they are awesome but still very basic. It's easier for me to find an basic application where I can download and debug it to see how it works and then modify or improve it. I will just keep looking ... just thought you knew a place where I could find such apps...

    Actually Hajan pointed you to a very good place....i would rather say instead of debugging an existed application, try to create on...that way you learn more....

    When it comes to the place, where you can get some sample applications -

    Open Source Projects and Starter Kits

    http://forums.asp.net/default.aspx/2

    And also there are other places on the web like codeproject.com. codeplex etc....

    Give a search in google or bing, definitely you will land up with some projects....but believe me the starter kits are really wonderful...


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 26, 2010 3:22 AM

All replies

  • User-1460196090 posted

    Hello @maximusmd.

    Firstly, welcome to the ASP.NET side :) - I hope you will have fun while coding and using Microsoft latest Technologies.

    Here are bunch of video tutorials that can help you achive your requirements: http://www.asp.net/web-forms/data

    You can read the tutorial titles and find the appropriate one that will fit all your requirements.

    Mainly, in ASP.NET there is a GridView control (which you already know about it) which have a lot of built-in functionalities that can be used for Insert,Update,Delete functions with database. Please, take a look at the tutorials and give us a feedback.

    Thank you.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 25, 2010 2:49 PM
  • User-1890047764 posted

    Here is the sample code through which you can get data from database and then bind the gridview. You can build on top of that code and enhance it or write some more code to achieve other desired results

     

    Private Sub FillGrid() 
            Dim cnConn As New SqlConnection(yourConnectionString)
            Dim cmdCommand As New SqlCommand
            cmdCommand.CommandText = "YourStoredProcedureName"
            cmdCommand.CommandType = CommandType.StoredProcedure
            cmdCommand.Connection = cnConn
    
            'If you have parameters then use the follwing block to sent them to
            'your stored procedure. Other wise no need to add this code.
            Dim parmMfrID As New SqlParameter
            parmMfrID.ParameterName = "@ParameterName"
            parmMfrID.Value = MfrID
            parmMfrID.Direction = ParameterDirection.Input
    
    
            cmdCommand.Parameters.Add(parmMfrID)
           '====================================
    
            
            Dim dt As New DataTable
            Dim da As New SqlDataAdapter
            da.SelectCommand = cmdCommand
    
            cnConn.Open()
            da.Fill(dt)
            cnConn.Close()
    
            
            GridView1.datasource=dt
            GridView1.databind()
        End Sub



     

    Friday, June 25, 2010 3:36 PM
  • User-356562709 posted

    yes I watched those videos and they are awesome but still very basic. It's easier for me to find an basic application where I can download and debug it to see how it works and then modify or improve it. I will just keep looking ... just thought you knew a place where I could find such apps...

    Thanks

     

    Friday, June 25, 2010 4:13 PM
  • User-278987542 posted

    hi maximusmd, 

     

        the following links has lot of videos, as your wish you can choose the videos.., it will may be help you...

             www.asp.net/downloads.  and www.LearnVisualStudio.NET

    by

    saravana

    Friday, June 25, 2010 8:20 PM
  • User-691245060 posted

    yes I watched those videos and they are awesome but still very basic. It's easier for me to find an basic application where I can download and debug it to see how it works and then modify or improve it. I will just keep looking ... just thought you knew a place where I could find such apps...

    Actually Hajan pointed you to a very good place....i would rather say instead of debugging an existed application, try to create on...that way you learn more....

    When it comes to the place, where you can get some sample applications -

    Open Source Projects and Starter Kits

    http://forums.asp.net/default.aspx/2

    And also there are other places on the web like codeproject.com. codeplex etc....

    Give a search in google or bing, definitely you will land up with some projects....but believe me the starter kits are really wonderful...


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 26, 2010 3:22 AM
  • User1789523204 posted

    The Best Formate for Asp.net SQL Is To use Microsoft Standard

    Like

    Always Create Procedure to Insert , Delete , Update , Select Data FroM DataBase


    Use Bll And DAL for Object and Function . do not write any db related function inside the page


    For More Information Visit www.msdn.com and click on webdevelopment

    Saturday, June 26, 2010 3:43 AM
  • User-1802908944 posted

    here you can find simple startkit application

    http://www.asp.net/community/projects



    Saturday, June 26, 2010 3:50 AM