error in Asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siri11
    New Member
    • Sep 2007
    • 38

    error in Asp.net

    Hi everyone..

    I'm developing an application in asp.net.In one of the web forms I have created the connection object and worte the connection string as follows...

    SqlConnection cn;
    cn = new SqlConnection(" User id=sa;pwd=sa;In itial catalog=xyz;Dat a source=serverna me;Persist Security Info=True");

    If i click one of the radio buttons the page is redirected to the page having the above code in the Page_Load event.But,the error i'm encountering with is

    "The ConnectionStrin g property has not been initialized. "

    I'm really having a trouble with this error since last 2 days...Please help..what is the problem actually....why is this error????


    Thanks in advance,
    siri
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Is this a remote or local connection?

    Comment

    • siri11
      New Member
      • Sep 2007
      • 38

      #3
      Originally posted by kenobewan
      Is this a remote or local connection?


      This is a local connection

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Not sure - try posting the rest of the relevant code in the page_load. Please remember to use code tags. Thanks.

        Comment

        Working...