PDA

View Full Version : سوال: خطای Login Failed To User بعد از نصب برنامه



pesare
پنج شنبه 30 خرداد 1392, 10:04 صبح
سلام دوستان
من برنامه ای که ساختم رو روی سیستم مقصد نصب کردم اما خطای Login Failed To User رو میده , کانکشن استرینگم هم اینه :


string cs = "Data source=.\\SQLEXPRESS;Attachdbfilename=|DataDirecto ry|\\{0};Integrated security=true;user Instance=true";
cs = string.Format(cs, this.DBName);


مشکل از چیه دوستان؟

Behnam6670
پنج شنبه 30 خرداد 1392, 10:19 صبح
سلام دوستان
من برنامه ای که ساختم رو روی سیستم مقصد نصب کردم اما خطای Login Failed To User رو میده , کانکشن استرینگم هم اینه :


string cs = "Data source=.\\SQLEXPRESS;Attachdbfilename=|DataDirecto ry|\\{0};Integrated security=true;user Instance=true";
cs = string.Format(cs, this.DBName);


مشکل از چیه دوستان؟


تستش کنuser Instance=False

pesare
پنج شنبه 30 خرداد 1392, 11:14 صبح
کد رو به این صورت تغییر دادم و لاگین کردن درست شد

string cs = "Data source=.\\SQLEXPRESS;Attachdbfilename=|DataDirecto ry|\\{0};Integrated security=SSPI;"

اما وقتی میخوام پرینت بگیرم دوباره خطای لاگین میده , من از استیمول استفاده میکنم و برای پرینت از دیتاگریدویو یه دیتا تیبل میسازم ,اصلا به بانک وصل نمیشم برای گزارش گیری ,در ضمن من کد دسترسی به بانکم فقط همین یه خط کد هست که توی یه کلاسه و در کل پروژه از اون استفاده میکنم ,حالا مشکل چیه؟

Behnam6670
پنج شنبه 30 خرداد 1392, 11:37 صبح
خطا رو بزار اینجا

pesare
پنج شنبه 30 خرداد 1392, 13:52 عصر
خطا اینه


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Data.SqlClient.SqlException (0x80131904): Cannot open database "AmlakPro" requested by the login. The login failed.
Login failed for user 'hamidreza-PC\hamidreza'.
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlInternalConnectionTds.Com pleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout)
at System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Stimulsoft.Report.Dictionary.StiSqlAdapterService. OpenConnection(IDbConnection connection, StiData data, StiDictionary dictionary) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \Dictionary\Adapters\StiSqlAdapterService.cs:line 304
at Stimulsoft.Report.Dictionary.StiSqlAdapterService. ConnectDataSourceToData(StiDictionary dictionary, StiDataSource dataSource, Boolean loadData) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \Dictionary\Adapters\StiSqlAdapterService.cs:line 381
at Stimulsoft.Report.Dictionary.StiDataSource.Connect (StiDataCollection datas, Boolean loadData) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \Dictionary\DataSources\StiDataSource.cs:line 1210
at Stimulsoft.Report.Dictionary.StiDataSourcesCollect ion.Connect(StiDataCollection datas, Boolean loadData) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \Dictionary\DataSources\StiDataSourcesCollection.c s:line 303
at Stimulsoft.Report.Dictionary.StiDictionary.Connect (Boolean loadData) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \Dictionary\StiDictionary.cs:line 1345
at Stimulsoft.Report.Engine.StiRenderProviderV2.Conne ctToData(StiReport report) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \Engine\EngineV2\StiRenderProviderV2.cs:line 613
at Stimulsoft.Report.Engine.StiRenderProviderV2.Rende r(StiReport report, StiRenderState state) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \Engine\EngineV2\StiRenderProviderV2.cs:line 327
at Stimulsoft.Report.Engine.StiReportV2Builder.Render SingleReport(StiReport masterReport, StiRenderState renderState) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \Engine\EngineV2\Builders\StiReportV2Builder.cs:li ne 140
at Stimulsoft.Report.StiReport.RenderReport(StiRender State renderState) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \StiReport.cs:line 4687
at Stimulsoft.Report.StiReport.Render(StiRenderState renderState, StiGuiMode guiMode) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \StiReport.cs:line 4527
at Stimulsoft.Report.StiReport.Show(Form parentForm, IWin32Window win32Window, Boolean dialogForm) in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \StiReport.cs:line 5059
at Stimulsoft.Report.StiReport.Show() in d:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report \StiReport.cs:line 4991
at املاک_نارنجی.frmApFroshi.btnPrint_Click (Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.296 (RTMGDR.030319-2900)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
املاک نارنجی
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Alireza%20Dabiri/Setup/%7F%7F%7F%7F%7F%20%7F%7F%7F%7F%7F%7F.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1002 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1001 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1001 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.233 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
FMessegeBox
Assembly Version: 2.0.2441.30181
Win32 Version: 2.0.*
CodeBase: file:///C:/Program%20Files/Alireza%20Dabiri/Setup/FMessegeBox.DLL
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.237 (RTMGDR.030319-2300)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.233 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
PersianDate
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Alireza%20Dabiri/Setup/PersianDate.DLL
----------------------------------------
PopupControl
Assembly Version: 1.4.0.968
Win32 Version: 1.4.0.968
CodeBase: file:///C:/Program%20Files/Alireza%20Dabiri/Setup/PopupControl.DLL
----------------------------------------
DevComponents.DotNetBar2
Assembly Version: 10.4.0.1
Win32 Version: 10.4.0.1
CodeBase: file:///C:/Program%20Files/Alireza%20Dabiri/Setup/DevComponents.DotNetBar2.DLL
----------------------------------------
Stimulsoft.Report
Assembly Version: 2013.1.1505.0
Win32 Version: 2013.1.1505.0
CodeBase: file:///C:/Program%20Files/Alireza%20Dabiri/Setup/Stimulsoft.Report.DLL
----------------------------------------
Stimulsoft.Base
Assembly Version: 2013.1.1505.0
Win32 Version: 2013.1.1505.0
CodeBase: file:///C:/Program%20Files/Alireza%20Dabiri/Setup/Stimulsoft.Base.DLL
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Stimulsoft.Report.Win
Assembly Version: 2013.1.1505.0
Win32 Version: 2013.1.1505.0
CodeBase: file:///C:/Program%20Files/Alireza%20Dabiri/Setup/Stimulsoft.Report.Win.DLL
----------------------------------------
Stimulsoft.Controls.Win
Assembly Version: 2013.1.1505.0
Win32 Version: 2013.1.1505.0
CodeBase: file:///C:/Program%20Files/Alireza%20Dabiri/Setup/Stimulsoft.Controls.Win.DLL
----------------------------------------
Stimulsoft.Controls
Assembly Version: 2013.1.1505.0
Win32 Version: 2013.1.1505.0
CodeBase: file:///C:/Program%20Files/Alireza%20Dabiri/Setup/Stimulsoft.Controls.DLL
----------------------------------------
53w2mcbu
Assembly Version: 0.0.0.0
Win32 Version: 4.0.30319.1001 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

pesare
پنج شنبه 30 خرداد 1392, 16:10 عصر
بعضی جاها پرینت میشه گرفت اما بضی جاها نمیشه , چرا اینجوریه؟

fakhravari
پنج شنبه 30 خرداد 1392, 16:18 عصر
ارسال کانکشن استریگ به استیمول یاد بگیر.
StiReport MyReport = new StiReport();
Stimulsoft.Report.Dictionary.StiSqlDatabase sti = new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", DAL.ConnectionString);
MyReport.Dictionary.Databases[0] = sti;

pesare
پنج شنبه 30 خرداد 1392, 16:23 عصر
از کد شما چطوری توی این کد استفاده کنم؟


DataTable dt = (DataTable)dataGridView1.DataSource;
stiReport1.Load("ApEjarehrpt.mrt");
stiReport1.RegData("DT1",dt);
stiReport1.Show();

fakhravari
پنج شنبه 30 خرداد 1392, 20:19 عصر
از کد شما چطوری توی این کد استفاده کنم؟


DataTable dt = (DataTable)dataGridView1.DataSource;
stiReport1.Load("ApEjarehrpt.mrt");
stiReport1.RegData("DT1",dt);
stiReport1.Show();
نیازی نداره.

pesare
جمعه 31 خرداد 1392, 10:25 صبح
دوست عزیز شما درست میگفتید , باید کانکشن استرینگ رو پاس میدادم به استیمول, کد نهایی این شد :


StiReport stiReport1 = new StiReport();
DataTable dt = (DataTable)dataGridView1.DataSource;
stiReport1.Load("ReportName.mrt");
stiReport1.Dictionary.Databases.Clear();
string cs = "Data source=.\\SQLEXPRESS;Attachdbfilename=|DataDirecto ry|\\DBName.mdf;Integrated Security=SSPI;";
stiReport1.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("DBName",cs));
stiReport1.RegData("DT1",dt);

fakhravari
جمعه 31 خرداد 1392, 12:15 عصر
عزیز دل برادر
اون کدی که تو گزاشتی دیتابیس کانکت ولی اون پست8 خبری از خوندن رشته اتصال نیست.
روش های زیادی هست برای دسترسی به داده ها. میتونی مستقیم وصل بشی به استیمول
-------------------------------------------------------------------
از همین جا از بچه های برنامه نویس byby میکنم .
میرم سربازی آموزشی کرمان شهید باهنر.
http://fakhravary.blogfa.com/post-41.aspx