I've error in my login page? [Resolved]

Posted by Sudheep.grandhe under C# on 10/31/2011 | Points: 10 | Views : 993 | Status : [Member] | Replies : 6
Hi,


I've error in my login page?

NullReferenceException was unhandled.I am underlying the error part.please do the needful.
con.ConnectionString = ConfigurationManager.ConnectionStrings["marsweb"] .ConnectionString;

Best,
Sudheep.



Responses

Posted by: Vuyiswamb on: 11/2/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 50

Up
0
Down

Resolved
This error is clear, it means you are trying to use a Connection string "marsweb" that does not exist in your Web config.



Thank you for posting at Dotnetfunda
[Administrator]

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 10/31/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,
please tell me why you have written this "conn.ConnectionString" ?

Akiii

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sudheep.grandhe on: 10/31/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

There is any error in that.can you please tell me the solution.

Best,
Sudheep.

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 10/31/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,
If you are writing the connection string in web.config file as this:-
<appSettings>

<add key="yourSettingInWebConfig"
value="server=(local)\NetSDK; database=Northwind; integrated security=SSPI" />
</appSettings>


code behind file in VB.NET:-
Dim strConnection As String = ConfigurationSettings.AppSettings("yourSettingInWebConfig")


code behind file in C#:-
string strConnection = ConfigurationSettings.AppSettings("yourSettingInWebConfig")


Now, use this string as you want. And also try this link:-
http://chanmingman.wordpress.com/2010/11/21/nullreferenceexception-was-unhandled-object-reference-not-set-to-an-instance-of-an-object-while-reading-connection-string-from-web-config/

Regards
Akiii

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sudheep.grandhe on: 11/9/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

I proudly said thanks to vuyiswamb.He was helpmed me a lot with the help of teamviewer he was resolve my queries.he done the good job in my case

Best,
Sudheep.

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sudheep.grandhe on: 11/9/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

I proudly said thanks to vuyiswamb.He was helpmed me a lot with the help of teamviewer he was resolve my queries.he done the good job in my case

Best,
Sudheep.

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response