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