Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Settings
Message
From
25/10/2006 16:51:20
 
General information
Forum:
ASP.NET
Category:
Security
Title:
Miscellaneous
Thread ID:
01164524
Message ID:
01164573
Views:
8
OK, so if it was working a month ago, something must have changed ... any idea what might have changed between now and a month ago? What's in CBCManager.Properties.Resources.APP_CONNECTIONSTRING?

~~Bonnie



>This is a Windows Forms application.
>
>Okay, I'm at a loss over this error:
>
>Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
>
>This is the code it says is causing the problem:
>
>frmLogin is simply a login form. Line with -> is the line with the error.
>
>oSQLConnection.ConnectionString =
>	CBCManager.Properties.Resources.APP_CONNECTIONSTRING +
>	"Data Source=" + frmLogin.ServerName.Trim() +
>	";User ID=" + frmLogin.UserName.Trim() +
>	";Password=" + frmLogin.Password;
>
>	try
>	{
>	oSQLConnection.Open();	//Attempt the connection
>	}
>
>	catch(SqlException oException)	// Fails-need to know why
>	{
>	     switch(oException.Number)
>	     {
>		// Invalid password/username
>		case 18456:
>		MessageBox.Show("Invalid User ID or password.");
>		break;
>
>		default:
>		{
>		MessageBox.Show(this.ShowSQLError(oException));
>		break;
>	        }
>	     }
>	     blnLoginError = true;	// Some error doesn't matter what
>	}
>
>	catch
>	{
>->	     throw;
>	}
>
>	finally	// we want to insure it loops back to the
>        {
>	blnLoginSuccess = !blnLoginError;
>	}
>
>
>This was working just a month ago, now I'm getting this error. What causes things like this and how do I get rid of them? I did not use the ClickOnce thing. Do I need to?
>
>When I first tried a test app with .NET, I got a similar error. I rebuilt it from scratch without using ClickOnce to get rid of it. I've gotten too far on this to go back to the drawing board.
>
>Richard
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform