Declaring the SqlConnection and SqlCommand objects in a webform without CodeBehind

Discussion in 'C#' started by bgryderclock, Sep 10, 2010.

  1. bgryderclock

    bgryderclock New Member

    Joined:
    Sep 10, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I am trying to query data from a MS SQL server with a C# web form without “CodeBehindâ€. I want to write the information to a table in the web form’s body.
    I am having trouble declaring the SqlConnection and SqlCommand objects that connect to the server.

    How do you use “using System;â€, “using System.Data;â€, “using System.Data.SqlClient†inside of script element of as .aspx file?


    I know how to do it with JavaScript and ADO. (code below)






    Any suggestions, links to articles or tutorials would be greatly appreciated.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice