C
chris
Hi,
I've developed a Windows Forms Application in Visual Studio 2003. I
built an MSI package using the setup and deployment projects setup
wizard. I ran the MSI package on my machine (where I developed the
application) to install it and I can run the application just fine. I
deployed it on another machine but when I ran the application I get an
error: Login Failed for user OFFICE\Display Wenzl. I have Sub Main as
my startup project and this is the code:
Sub Main()
Dim currentUser As WindowsIdentity =
WindowsIdentity.GetCurrent()
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
If (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Admin")) Or
(Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Users")) Then
Dim switch As New realSwitchboard
switch.ShowDialog()
Else
Dim sales As New realSwitchboardSales
sales.ShowDialog()
End If
End Sub
The user belongs in the PMS_Admin group. This is the error message I
get:
System.Data.SqlClient.SqlException: Login failed for user
'OFFICE\Display Wenzl'.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString
options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection
connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data,
Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at PMS.realSwitchboard.FillOptions()
at PMS.realSwitchboard.realSwitchboard_Load(Object sender, EventArgs
e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
I've tried deploying on other machines but I get the same "Login
Failed" error. What am I doing wrong?
Thanks in advance!
Chris
I've developed a Windows Forms Application in Visual Studio 2003. I
built an MSI package using the setup and deployment projects setup
wizard. I ran the MSI package on my machine (where I developed the
application) to install it and I can run the application just fine. I
deployed it on another machine but when I ran the application I get an
error: Login Failed for user OFFICE\Display Wenzl. I have Sub Main as
my startup project and this is the code:
Sub Main()
Dim currentUser As WindowsIdentity =
WindowsIdentity.GetCurrent()
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
If (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Admin")) Or
(Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Users")) Then
Dim switch As New realSwitchboard
switch.ShowDialog()
Else
Dim sales As New realSwitchboardSales
sales.ShowDialog()
End If
End Sub
The user belongs in the PMS_Admin group. This is the error message I
get:
System.Data.SqlClient.SqlException: Login failed for user
'OFFICE\Display Wenzl'.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString
options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection
connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data,
Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at PMS.realSwitchboard.FillOptions()
at PMS.realSwitchboard.realSwitchboard_Load(Object sender, EventArgs
e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
I've tried deploying on other machines but I get the same "Login
Failed" error. What am I doing wrong?
Thanks in advance!
Chris