SQL LocalDB vs SQL Server CE

See the Introducing SQL Server Express Local DB Runtime presentation – gives a great overview. The huge benefit of LocalDB is that it’s real SQL Server – it’s a special version of SQL Server Express, but it basically supports everything that “real” SQL Server has – spatial data types, stored procedures – you name it. … Read more

Can SQL Server Express LocalDB be connected to remotely?

No, SQL Server Express LocalDB doesn’t accept remote connections. The idea with shared network folder might work, but only if you are able to make sure the LocalDB instance is shutdown before you try to copy the file. Also keep in mind that only one LocalDB instance can have any given database file open at … Read more

Default instance name of SQL Server Express

When installing SQL Express, you’ll usually get a named instance called SQLExpress, which as others have said you can connect to with localhost\SQLExpress. If you’re looking to get a ‘default’ instance, which doesn’t have a name, you can do that as well. If you put MSSQLServer as the name when installing, it will create a … Read more

SqlServer 08: Query to list all databases in an instance?

sqlcmd -E -S SERVER\INSTANCE -Q “sp_databases” Notes: -E: Use a trusted connection (“Windows authentication”). Replace by -U username -P password for SQL Server authentication. -S SERVER\INSTANCE: The instance of SQL Server to which to connect. If you don’t know the name of your instance, you can use sqlcmd -L to get a list. -Q: The … Read more

SQL Insert Query Using C#

I assume you have a connection to your database and you can not do the insert parameters using c #. You are not adding the parameters in your query. It should look like: String query = “INSERT INTO dbo.SMS_PW (id,username,password,email) VALUES (@id,@username,@password, @email)”; SqlCommand command = new SqlCommand(query, db.Connection); command.Parameters.Add(“@id”,”abc”); command.Parameters.Add(“@username”,”abc”); command.Parameters.Add(“@password”,”abc”); command.Parameters.Add(“@email”,”abc”); command.ExecuteNonQuery(); Updated: … Read more