sql-server-express

Entity Framework EF4.1 - stored procedure “could not be found in the container”

余生长醉 提交于 2019-11-29 19:56:22
问题 I have a SP in my database. For EF4.1, using the DbContext API. After importing the function from the data model, references to the stored procedure works fine in my development environment. But when published to the server, it fails with a message like: The FunctionImport 'SqlSearch' could not be found in the container 'TallyJ2Entities'. All other data access is working fine. It seems that in production, some aspects of the EF4 configuration are forgotten. The databases are identical, and

At each login the program tries to configure installation parameters in the HKEY_LOCAL_MACHINE registry

倖福魔咒の 提交于 2019-11-29 18:08:46
After a program was installed by an admin user, different users with no admin rights experience the following problem with their logins to the same computer. At the installation of the program by an admin user, a generic connection information to a SQL database is written to a key in HKEY_LOCAL_MACHINE registry once (eg. (local)\sqlexpress ). Then this information in the registry is manually modified by the admin for the relevant database connection information (eg. Remote_location\sqlexpress ). So this information is machine specific, not user specific so that the program will work and fetch

All data from database is deleted when closing the application

泪湿孤枕 提交于 2019-11-29 15:32:20
What is the proper way to create a local-database file and then connect the app to it ? I want it to work even if you change the location of the project folder. Right know what I do is: Project -> Add new item -> Service-based Database and I create one and then I go to Data -> Add new Data Source, I add the created database and I get the connection string. Ok, all good, I can connect to it as I wish BUT all my data is erased from the database when I close the application (not always). For example, this code: SqlConnection c = new SqlConnection(@"DataSource=.\SQLEXPRESS;AttachDbFilename=

automate a SQL query to run every month

限于喜欢 提交于 2019-11-29 13:42:13
I have a simple SQL query that updates some date fields in a record, on a SQL Express instance. I'd like to have it run automatically every month. What is the best way of accomplishing this in SQL Server 2005 Express using the Management Studio? For SQL Server Express, there are a few possibilities. Unfortunately none of them involve Management Studio: Use a combination of Windows Scheduler, sqlcmd.exe, and .bat files Use SQL Server Service Broker Use a Codeplex variation of SQL Agent Use SQL Scheduler (free download) Create a job with monthly schedule in Sql Agent and assign a T-Sql task to

How to make SQL Server find a login matching the name provided?

我怕爱的太早我们不能终老 提交于 2019-11-29 09:53:17
I have just restored a database backup to my local SQL Server express instance. In management studio under the server instance node I went to: Security -> Logins -> New login... Then I filled in a login name, password and chose SQL Server authentication. And at the bottom I selected the newly restored database to be the Default database. At the User Mapping 'tab' at the left, I mapped the user to the newly restored database and gave it "db_owner" role. When I try to login the following error is given in the log: Login failed for user 'username'. Reason: Could not find a login matching the name

How to create a connection string in asp.net c#

僤鯓⒐⒋嵵緔 提交于 2019-11-29 04:35:26
I am working on asp.net c# project, for connection I used: SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=D:\19-02\ABCC\App_Data\abcc.mdf;Integrated Security=True;User Instance=True"); but I want to get this connection string to get configure and be like this, so can any one help how to create this kind of connection. SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["itmall"].ConnectionString); Demo : <connectionStrings> <add name="myConnectionString" connectionString="server=localhost;database=myDb;uid=myUser;password=myPass;" />

How to import .sql file into SQL Server Express

旧时模样 提交于 2019-11-29 03:40:04
问题 I have a plain sql file with some SQL INSERT statements. Is it possible to import it in my local SQL Server Express instance? 回答1: You can use Management Studio Express edition. You can download the latest version here - which will work against SQL Express 2005, 2008 and 2008 R2. If you don't want to install SSMSE then you can use sqlcmd at a command prompt, e.g. something like this (assuming Windows auth and an instance called "SQLEXPRESS"): sqlcmd -S .\SQLEXPRESS -E -i "C:\path\file.sql"

What happens when you hit the SQL Server Express 4GB / 10GB limit?

旧时模样 提交于 2019-11-29 03:00:38
What kind of error occurs? What do users experience? Can you access the database using tools and what if you get it back under the 4GB / 10GB limit? Jason As I understand it you will start to see exception messages appear within your event log, such as: Could not allocate space for object 'dbo.[table]' in database '[database]' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup. If you can then reduce the size of the database, you can then continue to add etc as before. Tools should carry on working regardless of the database

create table permission denied in database 'master'

陌路散爱 提交于 2019-11-28 23:41:30
I have installed the free version of sql server 2008 (sql server management studio express edition) on my PC. After installation I get the following error create table permission denied in database 'master' I tried reinstalling several times, but I keep getting the same error. When i checked select user_account(); It showed that I was logged in as guest. How do I solve this? since I am not permitted to create a new login. TheCodeKing I've read the error can be caused by UAC (on older versions of SQL Server Express). Try right-clicking on SQL Studio and running as administrator. If that doesn't

How do I view executed queries within SQL Server Management Studio?

烈酒焚心 提交于 2019-11-28 21:02:09
问题 I am new to SQL Server Management Studio and am wondering: is there is a way to see which queries have been run against a database? In the Activity monitor, there is a "Recent Expensive Queries" report but I'm guessing that isn't all of the queries since I'm not seeing the ones I have run. I am running SQL Server Express 2008 v 10.0.1600.22. 回答1: Use SQL Profiler and use a filter on it to get the most expensive queries. 回答2: Use the Activity Monitor. It's the last toolbar in the top bar. It