Sql connection string error, connection is aborted
I am creating a windows application.using sql server 2008.
I am getting connection string problem while connecting to .mdf file which is in this location c\folder\file.mdf.
first of all I have created 1 database in the sql with the tables. now I de-attached it. from c:\program files\sql server\data\mydb.mdf&mydb_log.ldf, I copied in desktop. now from my application when ever I am entering a text and then click create button event it ic creating a texbox1.text.mdf and textbox1_log.ldf. now I want to connect to this created database file.
I have give like this connection string but it is giving me connection is aborted and so on.
SqlConnection con = new SqlConnection(@"Data Source=.\SQLExpress;Integrated security=true;AttachDbFilename=c:\maq\" + textbox1.Text + ".mdf;Trusted_Connection=Yes");
Help me for this
I did this using .mdb it is successful but sql giving me trouble. I am new to use sql if I did any mistake please let me know I want learn a lot.
I'm not sure if this is the cause of your error but specifying booth
is redundant. They do the same (make use of windows authentication). Try remove one of them.
You should also specify a database name in your connection string as in here
That's probably the cause of your error.
SSIS package with ODBC source Teradata Deployment issue
SSIS package works fine in Visual Studio, But when deployed it says gives error, SQL Jobs fails execution0 votes0 answersSandesh J2 weeks ago
Connect to SQl with gMSA
I'm trying to make use of gMSA's to connect from ASP/X code to an MS SQL 2016 server. I've configured the gMSA with permissions on the target database and set up the gMSA on the source server, but can't get a connection string configured to use the account.0 votes0 answersSteve Sirag1 month ago
Non-Standard Port with SQL Server ODBC
Why does the SQL Server ODBC Connection page not mention any example of using a non-standard port? I was incorrectly trying to use the "Port" attribute as "Port=x" but that does not work.0 votes0 answersDavid Garcia4 months ago
NUODB to SQL database migration
Hi Guys I am using SQL Server 2012 , using import and export wizard i want to migrate nuodb databse to sql , but could not find any JDBC data source inside the wizard.0 votes0 answersGautam Raj4 months ago
Connection string issue in connecting to SQL Server
I am trying to connect my C# code to SQL Server. My connection string is not working. It gives the following error: "Format of the initialization string does not conform to specification starting at index 0."0 votes0 answersFaizan Rahman6 months ago
[Microsoft][ODBC Driver Manager] Data source file not found and no default driver specified.
I have a VBA code (in excel 2016) that i use to grab information from a MS SQL server (2008R). The connection works fine on the computer i wrote it on. When i run it on another computer i get the error "[Microsoft][ODBC Driver Manager] Data source file not found and no default driver specified".0 votes1 answerlee avery6 months ago
Remote MySQL Linked Server in SQL Server, only show names of the tables.
Remote MySQL Linked Server deployed in SQL Express Management Studio do not show any content and structure, it only LIST NAME of the tables belongs to the remote connected MySQL database0 votes0 answersAdrian Feldman6 months ago
connect from Oracle to MS SQL Server
I want to Connect from Oracle to MS SQL Server with a connection string to pass location (IP) / username / Password and SQL Database !0 votes0 answersFrank Lehmann6 months ago
Excel 2016 VBA OLE SQL connection help
Excel 2016 VBA to create an OLE connection to a sql 2014 db and then execute a stored procedure returning the results starting cell A1 on sheet :StoredProcData. Server & instance is QGZZZ\MYINSTANCE db is data0 votes0 answersRichard8 months ago
how to use regional settings when connecting to SQL Server with a connection string? Is there a parameter for it?
How do i specifiy to use the regional settings (those settings in Windows control panel) for numbers, dates and currency? When defining a DSN connection in ODBC manager Windows i can check to use the regional settings.0 votes0 answersMatthias Rebbe10 months ago
- Load more posts