SqlDataAdapter

Discussion in 'ASP .Net Web Controls' started by Morris Neuman, Dec 2, 2008.

  1. Hi,

    I am trying to implement the solution from the
    Walkthrough: Updating Data Using a Database Update Query in Web Forms

    In the walkthrough we are requested to drag a SqlConnection object onto the
    page from the Data tab of the Toolbox.

    I don't see SqlConnection object in my Toolbox Data tab. I right clicked
    the Data tab and selected "Choose Items", then clicked on the SqlCommand,
    SqlConnection and SqlDataAdapter, then OK, however I still do not see these
    objects in my Toolbox.

    I then added the following statement to my MasterPage, but still no help.
    <%@ Import Namespace="System.Data.SqlClient" %>

    Note, I am using a Master page and trying this walkthrough app on the
    Contents page.

    Can you please tell me how I can have these tools displayed in my toolbox?

    I am using .Net 2.0, SQL 2005
     
    Morris Neuman, Dec 2, 2008
    #1
    1. Advertisements

  2. Morris Neuman

    Steven Cheng Guest

    Hi Morris,

    This is a known issue due to a redesign.

    http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedbac
    kID=104995

    To use the SqlConnection class we don't have to show it in the Toolbar. We
    can write code in the code behind directly. You can refer to the following
    documentation to know how to write code:

    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.
    aspx

    BTW, in ASP.NET 2.0, using DataSource control is a recommended way. You can
    follow the quickstart to learn how to use them.

    http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/default.asp
    x

    If you need further assistance please feel free to ask.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

    Note: MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 2 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions. Issues of this
    nature are best handled working with a dedicated Microsoft Support Engineer
    by contacting Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng, Dec 3, 2008
    #2
    1. Advertisements

  3. Thanks for your quick reply.

    I will look at the example for the code behind.

    I do normally use DataSource control for gridview, detailview, etc.

    However I want to perform a database action based on a button_click event
    and don't know how to use a datasource control for the click event. Is there
    a way to use a datasource for the click event?
     
    Morris Neuman, Dec 3, 2008
    #3
  4. Hi Morris,

    The SqlDataSource control has some methods that can help to query database.
    We can call them to select, update, insert and delete records. Please check
    out the following documentations to learn how to use these methods:

    Select:
    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasou
    rce.select.aspx

    Update:
    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasou
    rce.update.aspx

    Insert:
    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasou
    rce.insert.aspx

    Delete:
    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasou
    rce.delete.aspx

    If you have further questions please feel free to ask.

    Regards,
    Allen Chen
    Microsoft Online Community Support
     
    Allen Chen [MSFT], Dec 4, 2008
    #4
  5. Hi Morris,

    Have you got the expected answer?

    Regards,
    Allen Chen
    Microsoft Online Community Support
     
    Allen Chen [MSFT], Dec 8, 2008
    #5
  6. Hi Morris,

    Have you got the expected answer?

    Regards,
    Allen Chen
    Microsoft Online Community Support
     
    Allen Chen [MSFT], Dec 8, 2008
    #6
  7. Yes thank you.
     
    Morris Neuman, Dec 8, 2008
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.