Sqlconnection
-
Hi all.am really new to asp.net,c# as well as sql.i hope you will help me on this.
i want to call my stored procedure from my class file. and later create an instance of the class in the .aspx.cs file.to do this i have to create a connection object and pass in my configuration key from web.config. that is where am stuck because i had used this:
SqlConnection connection = new SqlConnection ( ConfigurationManager.ConnectionStrings [‘’B.F.M.S”].ConnectionString);
B.F.M.S is my sql database.
Now when i run my application its giving a [NullReference Exception: Object reference not set to an instance of an object].
the error is with that line.
Can you please help on how i can rectify that. -
Hi all.am really new to asp.net,c# as well as sql.i hope you will help me on this.
i want to call my stored procedure from my class file. and later create an instance of the class in the .aspx.cs file.to do this i have to create a connection object and pass in my configuration key from web.config. that is where am stuck because i had used this:
SqlConnection connection = new SqlConnection ( ConfigurationManager.ConnectionStrings [‘’B.F.M.S”].ConnectionString);
B.F.M.S is my sql database.
Now when i run my application its giving a [NullReference Exception: Object reference not set to an instance of an object].
the error is with that line.
Can you please help on how i can rectify that.You have already posted this in the ASP.NET forum. Posting the same question in multiple forums duplicates work and annoys people.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer