SqlConnection problem on ASP.NET Web Application
-
Possible reasons. 1. The server won't allow you to connect using that Data Source becuase the datasource indicates that TCP/IP is used. * Use a datasource name that does not require TCP/IP * Set up SQL Server to permit TCP/IP connections. 2. The user name or password is incorrect. * Check the user name and password combination is correct * Use a trusted connection instead
Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Different ways to add point data in SQL Server 2008 * Spatial References in SQL Server 2008 My website |
what if I don't have any password?? What should I use for password?? One more think: When I am writing the data source like this: "Data Source=.\SQLEXPRESS" it gives me a error and it says: "Unrecognized escape sequence", and when I am turning the slash otherway: "Data Source=./SQLEXPRESS" it says is ok. Does that make any difference??? Thanks for the help
-
what if I don't have any password?? What should I use for password?? One more think: When I am writing the data source like this: "Data Source=.\SQLEXPRESS" it gives me a error and it says: "Unrecognized escape sequence", and when I am turning the slash otherway: "Data Source=./SQLEXPRESS" it says is ok. Does that make any difference??? Thanks for the help
laziale wrote:
what if I don't have any password?? What should I use for password??
As I said already - Use a trusted connection instead. See http://www.connectionstrings.com/[^]
laziale wrote:
When I am writing the data source like this: "Data Source=.\SQLEXPRESS" it gives me a error and it says: "Unrecognized escape sequence", and when I am turning the slash otherway: "Data Source=./SQLEXPRESS" it says is ok. Does that make any difference???
Ummm... Yes. Why explain what the difference is, then ask me if there is a difference?
Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Different ways to add point data in SQL Server 2008 * Spatial References in SQL Server 2008 My website |
-
laziale wrote:
what if I don't have any password?? What should I use for password??
As I said already - Use a trusted connection instead. See http://www.connectionstrings.com/[^]
laziale wrote:
When I am writing the data source like this: "Data Source=.\SQLEXPRESS" it gives me a error and it says: "Unrecognized escape sequence", and when I am turning the slash otherway: "Data Source=./SQLEXPRESS" it says is ok. Does that make any difference???
Ummm... Yes. Why explain what the difference is, then ask me if there is a difference?
Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Different ways to add point data in SQL Server 2008 * Spatial References in SQL Server 2008 My website |
well, I did my connection now as: "Data Source=./SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\angel.MMB\My Documents\Visual Studio 2005\WebSites\WebSite2App_Data\test2.mdf;Trusted_Connection=true" and the connectionString now is same in the OnClick event of the button and in the web config with the only difference that in the web config file I have
-
well, I did my connection now as: "Data Source=./SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\angel.MMB\My Documents\Visual Studio 2005\WebSites\WebSite2App_Data\test2.mdf;Trusted_Connection=true" and the connectionString now is same in the OnClick event of the button and in the web config with the only difference that in the web config file I have
Hi laziale i want to know did you are using msaccess as backend??? Yogesh Agarwal
-
Hi laziale i want to know did you are using msaccess as backend??? Yogesh Agarwal
yogesh_kumar_agarwal wrote:
i want to know did you are using msaccess as backend???
Obviously he isn't. His previous post indicated that he was using the Express edition of SQL Server.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
yogesh_kumar_agarwal wrote:
i want to know did you are using msaccess as backend???
Obviously he isn't. His previous post indicated that he was using the Express edition of SQL Server.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
i think you didn't read the connection string properly he tries to connect with a mdb database file means Access Yogesh Agarwal
-
Hi laziale i want to know did you are using msaccess as backend??? Yogesh Agarwal
-
i think you didn't read the connection string properly he tries to connect with a mdb database file means Access Yogesh Agarwal
yogesh_kumar_agarwal wrote:
i think you didn't read the connection string properly he tries to connect with a mdb database file means Access
No, you didn't read the connection string properly. The database file he was trying to connect to had a .mdf extension, not a .mdb extension. This is consistent with trying to connect to a SQL Express database, as this article[^] indicates. In the future, I suggest that you get your facts straight before engaging in a discussion.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
yogesh_kumar_agarwal wrote:
i think you didn't read the connection string properly he tries to connect with a mdb database file means Access
No, you didn't read the connection string properly. The database file he was trying to connect to had a .mdf extension, not a .mdb extension. This is consistent with trying to connect to a SQL Express database, as this article[^] indicates. In the future, I suggest that you get your facts straight before engaging in a discussion.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
Yes, i realize it, Sorry for discussion with regards Yogesh Agarwal
-
hi! I am building one web site, and I am a beginner in ASP.NET, I am attaching a database to the project and when I want to start the application I have this problem: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider Here is my connection string: SqlConnection con = new SqlConnection("Data Source=DILI/SQLEXPRESS;Initial Catalog=|App_Data|test2.mdf; user id=xxxx;password=xxxx;"); con.Open(); SqlCommand cmd = new SqlCommand("INSERT INTO test VALUES ('" + TextBox1.Text + "')"); cmd.ExecuteNonQuery(); Any Help?? Thanks Ahead
i had the same problem .WHEN i had not started the SQL server when i was running the page . try to use the designer for the database connection . writing the code by yourself may caused errors.
f(yf) = yf