Password In Sqlconnectionstring
Aug 14, 2007
Hi all.
Is it safe to have my id and password in SqlConnectionString? I have the pw/id in one of aspx file and don't feel secure.
I read from somewhere that it is a better idea to store the string in web.config, but I don't understand how that makes it more secure.
View 2 Replies
ADVERTISEMENT
Nov 17, 2007
Hi. I just uploaded our website on a free hosting service, called aspspider.net. I am having problems with the database. I uploaded the .mdf file and attached it. I think the problem lies with the sqlConnectionString, and I was hoping someone could help me it. First off, here is a tip from the hosting developers on how to set the connection string:http://www.aspspider.net/tips/Tip18.aspx.It says, "Data Source=.SQLExpress;Persist Security Info=True;Integrated Security=SSPI;Initial Catalog=YourUserId_DatabaseName" My UserId (that I signed up with) is "RedTeamBattleship", and the database name that I uploaded is called "ASPNETDB.MDF".Now here is what I had in TestDatabase.aspx.cs, running on the localhost. It used to work fine:String sqlConnectionString = @"Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True"; // connects to the localhost Following their pattern, I made the following connection string:String sqlConnectionString = @"Data Source=.SQLExpress;Persist Security Info=True;Integrated Security=SSPI;Initial Catalog=RedTeamBattleship_ASPNETDB.MDF"; // connects to the DB hosted on ASPSpiderUnfortunately, it did not work. I tried to Google for a solution, and someone had mentioned their problem was solved when they added "user instance=false;" so I added it. However, I didn't notice any difference.String sqlConnectionString = @"Data Source=.SQLExpress;Persist Security Info=True;Integrated Security=SSPI;user instance=false;Initial Catalog=RedTeamBattleship_ASPNETDB.MDF"; // connects to the DB hosted on ASPSpider
Now every time I run the application, I get the following exception: Server Error in '/RedTeamBattleship' Application.Cannot open database "RedTeamBattleship_ASPNETDB.MDF" requested by the login. The login failed.Login failed for user 'DOTNETSPIDER3RedTeamBattleship'.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Data.SqlClient.SqlException: Cannot open database "RedTeamBattleship_ASPNETDB.MDF" requested by the login. The login failed.Login failed for user 'DOTNETSPIDER3RedTeamBattleship'.Source Error:An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.Stack Trace:[SqlException (0x80131904): Cannot open database "RedTeamBattleship_ASPNETDB.MDF" requested by the login. The login failed.Login failed for user 'DOTNETSPIDER3RedTeamBattleship'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +170 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +349 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +41 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360 In addition, I changed the one in the Web.Config file, though I'm not sure if I should have done so.I changed it from: <connectionStrings> <add name="MyDbConn1" connectionString="Server=MyServer;Database=MyDb;Trusted_Connection=Yes;"/> <add name="MyDbConn2" connectionString="Initial Catalog=MyDb;Data Source=MyServer;Integrated Security=SSPI;"/> <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings>To: <connectionStrings> <add name="MyDbConn1" connectionString="Server=MyServer;Database=MyDb;Trusted_Connection=Yes;"/> <add name="MyDbConn2" connectionString="Initial Catalog=MyDb;Data Source=MyServer;Integrated Security=SSPI;"/> <add name="ConnectionString" connectionString="Data Source=.SQLExpress;Persist Security Info=True;Integrated Security=SSPI;user instance=false;Initial Catalog=RedTeamBattleship_ASPNETDB.MDF" /> </connectionStrings> And the application still crashes with the same way.Can someone help me fix that problem? Thank you very much.
View 14 Replies
View Related
Dec 20, 2007
Hi.I realize this may have been asked a thousand times before, but it's still not working for me. I would appreciate any help with it. First, I created a GridView, and from it I created a new SqlDataSource and let it point to the database in C:My ProjectApp_DataASPNETDB.MDF. This automatically created a connectionString in the Web.Config file, saying the following: "R1ASPNETDBConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename="C:My ProjectApp_DataASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" /> Now when I try to programatically use that connection string, the program crashes. Below is my code: <script runat="server"> String sqlConnectionString = @"Data Source=.SQLEXPRESS;AttachDbFilename="C:My ProjectApp_DataASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True";
protected void Page_Load(object sender, EventArgs e) { using (SqlConnection conn = new SqlConnection(sqlConnectionString)) { conn.Open(); const String selectQuery = "SELECT StatusName FROM Status ORDER BY StatusName"; Label1.Text = ""; using (SqlCommand cmd = new SqlCommand(selectQuery, conn)) { SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { Label1.Text += dr[0]; while (dr.Read()) { Label1.Text += ", "; Label1.Text += dr[0]; } Label1.Text += ". "; } else
Label1.Text = "None."; } if (conn != null) conn.Close(); } } Here's the error message I'm getting: Server Error in '/My Project' Application.
Keyword not supported: 'c:my projectapp_dataaspnetdb.mdf";integrated security'.
Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.
Exception Details: System.ArgumentException: Keyword not supported: 'c:my projectapp_dataaspnetdb.mdf";integrated security'.
Source Error:
Line 15: protected void Page_Load(object sender, EventArgs e)Line 16: {Line 17: using (SqlConnection conn = new SqlConnection(sqlConnectionString))Line 18: {Line 19: conn.Open();
Source File: c:My Project est.aspx Line: 17
Stack Trace:
[ArgumentException: Keyword not supported: 'c:my projectapp_dataaspnetdb.mdf";integrated security'.] System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +417 System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +99 System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +52 System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +25 System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +141 System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +38 System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4 System.Data.SqlClient.SqlConnection..ctor(String connectionString) +21 ASP.test_aspx.Page_Load(Object sender, EventArgs e) in c:My Project est.aspx:17 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +45 System.Web.UI.Control.OnLoad(EventArgs e) +80 System.Web.UI.Control.LoadRecursive() +49 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3745 My question is: How should I write the connection string? I have a feeling the problem is with the quotes ("), but I can't figure out how to write it otherwise.Thank you very much.
View 2 Replies
View Related
Sep 11, 2007
Hi all,
I am creating an app using VS 2005 C++ which will create and manipulate data in a MS SQL 2005 Server. The ConnectionString is have as:
"Persist Security Info=False;Integrated Security=SSPI;database=master;server=MYSERVER"
My question is, if I distribute the application after it's complete and working as it should, how do I set the 'server=' if each PC it runns under will obviously have a different SQL Server name.
How do I set the server to work on any SQL 2005 installation ?
Cheers
Pete
View 4 Replies
View Related
Jul 24, 2015
I have connected to Database using my credentials by checking remember password option. After few days I forgot my password. How can I recover the password as SQL remember it. Is there any way to recover my password instead of resetting it.
View 3 Replies
View Related
Apr 1, 2008
I have a package protected by a password - I am already unhappy that to get it to use the configuration file to change connection strings for the production servers I have had to hardcode the password into the config file - very insecure!
However, the package now deploys correctly to the production server and will run from there OK, but NOT if scheduled as a SQL Server Agent Job. Thus is because however often I edit the command line to include the password after the DECRYPT switch (which it has prompted me for when I click on the command line tab), the Job Step will not retain it.
If I open it up after I have edited it and closed it, the password has disappeared.
I know that if I run dtexec plus the code in the Command Line tab (with the password), the package runs OK.
This is driving me insane!
I have read all the other posts and so I tried replacing the SSIS package step with a CmdExec step and pasting that code into there - then I get an OLEDB error..
The code I use is:
DTEXEC /SQL "ImportRateMonitoringTables" /SERVER servername /DECRYPT password /CONFIGFILE "D:Microsoft SQL ServerSSISDeploymentsRateMonitoringImportTasksDeploymentImportRateMonitoringTables_Production.dtsConfig" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E
and I get
SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x8000FFFF
although the same code executes perfectly from a command prompt.
Please does anyone have any experience with a similar problem and if so, how did you get round it?
Thank you
View 9 Replies
View Related
Jun 18, 2007
I am receiving the following error message when attempting to create a new SQL Authenticated login id.
Password validation failed. The password does not meet the requirements of the password filter DLL. (Microsoft SQL Server, Error: 15119)
I have four servers all running SQL Server 2005 SP2 on Windows 2003 Ent. SP1. Of the four servers, only one received the above error message using the same TSQL below.
CREATE LOGIN TEST_LOGIN WITH PASSWORD = 'pvif9dal' MUST_CHANGE, CHECK_EXPIRATION = ON
All four servers are in the same domain, which if I understand correctly, the password policies are therefore inherited at the OS level by the domain. The password being used is within the password policies of the domain.
Any ideas as to a root cause?
View 5 Replies
View Related
Jun 30, 2007
I tried to install an ALLDATA database which run with SQL Server 2005 express edition. The data base fails to install becase of the following code that come up which is related to AS password requirement. The error that come up is:
TITLE: Microsoft SQL Server 2005 Setup
------------------------------
The sa password must meet SQL Server password policy requirements. For strong password guidelines, see Authentication Mode, in SQL Server Books Online.
For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=setup.rll&EvtID=28001&EvtType=sqlca%5csqlcax.cpp%40SAPasswordPolicyCheck%40SAPasswordPolicyCheck%40x6d61
------------------------------
BUTTONS:
&Retry
Cancel
------------------------------
I am trying to install this database in a network server operating under Windows Server 2003 R2 with SP2. If anyone knows how to solve this problem, please let me.
Thanks,
Amilcar
View 6 Replies
View Related
Mar 11, 2008
On the login prompt for Report Server, there is a checkbox option to "Remember my Password." I check this, login successfully... but when returning to the Report Server, I am again prompted for the password, although the user name is saved. No matter how many times I do this, the password will not save in IE7. I have tried this on 3 different computers with IE7. In IE 6, I do not even get the checkbox as an option, just the user name/password prompt. In Firefox, the password saves fine. Any ideas what would be causing this?
Thanks,
Brian
View 1 Replies
View Related
Jun 2, 2014
I put this together to export the user name /password to a csv file to test my SP to output the user name/password.
DECLARE @user_name varchar(50)
DECLARE @psswrd varchar(10)
SELECT @user_name ,@psswrd
FROM ngweb_bulk_enrollments
EXEC master.dbo.xp_cmdshell 'bcp NGDevl.dbo.ngweb_bulk_enrollments out C: est.csv -Sserver1 -T -t, -r
-c'
This works but I don't get the headers in the file. How can I include the headers?
View 7 Replies
View Related
Mar 3, 2005
I have an internal Project Management and Scheduling app that I wrote internally for my company. It was written to use MySQL running on a Debian server, but I am going to move it to SQL Server 2000 and integrate it with our Accounting software. The part I am having trouble with is the user login portion. I previously used this:
PHP Code:
$sql = "SELECT * FROM users WHERE username = "$username" AND user_password = password("$password")";
Apparently the password() function is not available when accessing SQL Server via ODBC. Is there an equivalent function I could use isntead so the passwords arent plaintext in the database? I only have 15 people using the system so a blank pwd reset wouldn't be too much trouble.
View 7 Replies
View Related
Jun 28, 2007
I am building a website in Dreamweaver. I have tried and tried to get a connection to SQL 2005. Everything works on the web except the stuff that requires the use of my SQL tables. With OPEN_Conn ="Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=master" I get an error at the bottom of my page saying this:
Microsoft OLE DB Provider for SQL Server error '80004005'
Invalid authorization specification
When I add a password and ID to the string the pages become very slow and I get this error:
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Using windows authentication when logging into SQL Server doesn't have a user id or password so maybe I just don't know what to put there. I have tried a mix of all the passwords and ID's I use on this computer. Do I even have to have the user ID and password and if not how do I fix the first error? All help appreciated.
View 10 Replies
View Related
Oct 25, 2007
Hi All.
Have a nice day.
in my project asp.net web.config file has
<connectionStrings> <add name="MyDbConn" connectionString="Data Source=NAVEEDSQLEXPRESS;Initial Catalog=QADB_2005;Persist Security
Info=True;User ID=db1;Password=12345;" providerName="System.Data.SqlClient" /> </connectionStrings>
I want to change password of database, how can i change. please can you assist.
Thanks.
Zahyea.
View 2 Replies
View Related
Jul 22, 2002
Hello ,
Is is correct that the 'sa ' passoword is stored in one of the files of the SQL Server and is easily readable if the location of the file is known ?
If not , then is the password encrypted when i try to connect to the SQL server on the Internet ?
Thanks.
Sameer.
View 3 Replies
View Related
Jul 18, 2000
I am designing a DTS package which i need to update every so often to change the name of the source file(it's a text import). Every time that i change this, then click save, the DTS job begins to fail, with password errors. I put the password back in correctly( i still don't know why it gets lost in the first place), and click save - same result. this is getting tremendously frustrating, so i really appreciate any answers.
View 3 Replies
View Related
Feb 15, 2001
I will like to Change the SA Password, Do i have to go thru all the DTS packages and Jobs to change it too?
Thanks
View 1 Replies
View Related
Apr 2, 2001
I need to get a password out of SQLServer 6.5. The account is a user account. I need to get the password so that I can create a development database. The DBA's that know the password have left the company, and I can not just change the password. Please HELP!!!
View 1 Replies
View Related
Apr 26, 1999
Recently my husband has taken the position of IS Manager for a major hotel Firm.
The IS Manager that was there before him had a SQL Server which held some of the hotels data.
He did not leave the SA password. How do you find out what the SA password is
if you do not have it? I do not know what to tell him. Does anyone out there
have any idea what he can do?
Thanks in advance for your help.
Dianne
View 4 Replies
View Related
Nov 5, 1998
Can someone tell me if there is a password in Entereprise manager.
I've been having trouble with Scheduled tasks.
There are not running anymore.
THANK YOU.
View 1 Replies
View Related
Jul 30, 2001
Hi!
When I try to set password for any login begining from 'sa' using Enterpr. Manager or sp_password I get error message:
'Server: Msg 552, Level 16, State 1, Procedure sp_password, Line 63
CryptoAPI function 'CryptAcquireContext' failed. Error 0x80090006: Invalid Signature.'
What does it mean?
Thank you,
Elena.
View 1 Replies
View Related
Sep 14, 2001
Is there anyway to "get in the backdoor" if you have installed SQLserver and assigned sa a password (no other users are set up with admin rights) and then forget what the password is.
In the online doc it says you have to reinstall SQL server....isn't there any other way to get in??? For instance in SYBASE you can log on to the console and "go thru the backdoor" and issue a command from there.
Please advise.
View 1 Replies
View Related
Feb 15, 2001
I will like to Change the SA Password, Do i have to go thru all the DTS packages and Jobs to change it too?
Thanks
View 1 Replies
View Related
Jun 29, 2004
How do i get a password from the master database for a sql user account?
Someone created a password for a sql account and forgot what it was...
View 14 Replies
View Related
Dec 29, 2004
All
I can not change the 'sa' password, it's give me the error attached.
What can I do?
Thks
View 6 Replies
View Related
Dec 29, 2004
I can not change the 'sa' password. It's showing the error below:
<<Error 21776: [SQL-DMO The name 'dbo' was not found in the Users collection. If the name is a qualified name, use [] to separate various parts of the name, and try again.>>
What can i do?
Thks
View 1 Replies
View Related
Feb 10, 2004
I have a DTS saved as a structered storage file.How can I provide SQL SERVER Logon ID and password for this DTS package and call it within a SP through the LOGON ID and Password?
View 1 Replies
View Related
Apr 27, 2004
Hi,
Is there any way to show one column(password) values as ***.
One of my table has password field, when you query the table it will give actual value, i wanted to show them as **** or with junk charecters.
FYI..column data type is varchar(50).
Thanks in advance.
View 8 Replies
View Related
Nov 14, 2006
Is there a way on a databse that the a password field is encrypted and no one can see what it is. I have loooked under dadt types and cant see it
View 1 Replies
View Related
Apr 18, 2007
Dear Friends,
for one of my personal application, i forgot password, and after request, the admin send the pass word as " *2S}_P|!Krpa8P " how can i decrypt this with sql query?
thank you very much
Vinod
View 6 Replies
View Related
Apr 19, 2007
Hi,
I am new to SSIS.I need to run FTP process which is done manually currently.
We have different vendors uploading files @client FTP.
we have to copy the files from FTP to prod server & send mail to DBA.
The FTP has passwords encrypted & each vendor has its own password.
How do I go about doing it.
Please also suggest good article for FTP.
View 2 Replies
View Related
Jul 11, 2007
sql profiler shows eventclass "audit login failed" on the same server i changed the sa password on an average of every 20 minutes.
I cant find out how is this application using the sa password. The application name is SQL Server.
Any ideas?
=============================
http://www.sqlserverstudy.com
View 12 Replies
View Related
Aug 10, 2007
My predecessor, did not document the password for sa and had disabled the builtin admin account, is there another way in or will i have to re-install SQL 2005
Jay
View 3 Replies
View Related
Jul 23, 2005
Folks,Sorry 'bout this. I'm sure it must be an FAQ, but I can't find the answerafter many hours of looking :-(I don't know the SA password any more. Is there a mechanism for setting (orresetting) this to a known value? My assumption is that the encryption issufficiently strong that it can't be discovered from viewing the data ?Yes - I have physical access to the machine, with Administrator logonprivilege.Any help would be most welcome!Season's Greetings, etcHazBin
View 2 Replies
View Related