mdf

Can't connect to my own MDF file. Cannot open user default database. Login failed.Login failed for user… and other errors

荒凉一梦 提交于 2019-12-04 11:37:41
SQLSEXPRESS service IS running!! I have I program I wrote some time ago and it works. It was written in MS Visual Studio with local MDF file. How is it possible to edit this file from Microsoft SQL Server Management Studio? I don't see this file in the list of globally connected databases. If I try to attach this file with Visual Studio Wizard, I get message that such database already exists, but when I set arbitrary logical name, I get sharing violation. How to reach MDF file? EDIT 1 Now I found that my program also stopped to work. The summary of results of different attempts to reach MDF

Data lost from .mdf file as I exit application

倖福魔咒の 提交于 2019-12-04 05:53:21
问题 Recently I work on SQL Server 2008 R2 database. I create database and attach .mdf file of same database in my application with some default data in it . Run application default data coming properly. Now I insert, update some data in my application and its works fine. But as I exit application and again run application lastly added and updated data get lost but default data coming proper as earlier. Please help. Why new 回答1: As mention by @Henk , @Microtechie , I scan my project folder and

Populate checkboxlist with items from database?

荒凉一梦 提交于 2019-12-03 16:43:00
Ok, so I want to populate/bind some data to a checkboxlist but cannot seem to binf the right values? I want to populate it with the information from a ROW, not the whole column which is what's happening to me. Here's some code anyways to show you what the problem is. This is the code in the xaml <form id="form1" runat="server"> <div> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [Option1], [Option2], [Option3] FROM [Questions] WHERE ([QuestionID] = @QuestionID)"> <SelectParameters> <asp:Parameter

What is the best local-database solution for WPF applications?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 13:17:32
问题 What is currently the best solution for WPF applications which are meant to be used on one computer where various users log into them and use them to get/save information locally? Here's how I see the options: MDF would seem to be the best choice since I assume you can lock it down quite well so that even though users can access the .mdf file, they still couldn't access the data in it except through the application itself. I assume the .MDF file would have to exist separately from the

How to recover database from MDF in SQL Server 2005?

不羁岁月 提交于 2019-12-03 03:54:58
问题 I have an MDF file and no LDF files for a database created in MS SQL Server 2005. When I try to attach the MDF file to a different SQL Server, I get the following error message. The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only. This error could occur if the transaction log file was manually deleted or lost due to a hardware or environment failure. I would like to

SQL - How to backup a database and export as a MDF file with MS SQL 2008 R2

倖福魔咒の 提交于 2019-12-02 23:38:55
I have created a database "test" with some tables in MS SQL Server 2008 R2 (i.e. MS SQL Server Management Studio). Now, I need to export this database as a MDF file. What should I do? Gabriel McAdams If you mean that you want to be able to attach the database on another server, then this is what you can do: detach the database (right click the database and click Detach ) copy the mdf and ldf files to your backup location attach the database (right click Databases and click Attach ) This is the path where you will find MDF file: C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL

Why is my table not being created?

∥☆過路亽.° 提交于 2019-12-02 17:21:30
问题 I've got this code in my Winforms app to create a table in an existing database, (which I created by following what is written here): private void CreateTables() { string connStr = @"Data Source= (LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory| \AYttFM.mdf;Integrated Security=True"; using (var connection = new System.Data.SqlClient.SqlConnection(connStr)) { try { connection.Open(); using (var command = connection.CreateCommand()) { StringBuilder sb = new StringBuilder(); sb.Append(

How to open a SQL Server .mdf file with Python (pandas)

岁酱吖の 提交于 2019-12-02 11:26:09
问题 I'm trying to open a mdf sql database file that I have saved to my desktop. How do you open it as a pandas dataframe? so far all I have is the following: conn=pyodbc.connect(driver='{SQL Server}', dsn=filepath) Its giving me the error message OperationalError: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied (0) (SQLDriverConnect)') I found another question that was similar but it was also unanswered. I have also been unable to find a good tutorial

Why is my table not being created?

强颜欢笑 提交于 2019-12-02 08:32:02
I've got this code in my Winforms app to create a table in an existing database, (which I created by following what is written here ): private void CreateTables() { string connStr = @"Data Source= (LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory| \AYttFM.mdf;Integrated Security=True"; using (var connection = new System.Data.SqlClient.SqlConnection(connStr)) { try { connection.Open(); using (var command = connection.CreateCommand()) { StringBuilder sb = new StringBuilder(); sb.Append("CREATE TABLE [dbo].[AssignmentHistory] "); sb.Append("("); sb.Append("[Id] INT NOT NULL PRIMARY KEY, ");

How to open a SQL Server .mdf file with Python (pandas)

泄露秘密 提交于 2019-12-02 06:35:07
I'm trying to open a mdf sql database file that I have saved to my desktop. How do you open it as a pandas dataframe? so far all I have is the following: conn=pyodbc.connect(driver='{SQL Server}', dsn=filepath) Its giving me the error message OperationalError: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied (0) (SQLDriverConnect)') I found another question that was similar but it was also unanswered. I have also been unable to find a good tutorial to start using sql databases with python I'm very new to the topic. Let me know if there is any extra