SQL Server - want to embedd a database in sqlexpress edition

Asked By Suny Jose
06-Oct-08 06:32 AM

please tell me how

thanks in advance

check this page on msdn  check this page on msdn

06-Oct-08 06:40 AM
in this msdn website it gives you total info regarding embedding sql server express into custom application

http://msdn.microsoft.com/en-us/library/bb264562.aspx

re  re

06-Oct-08 06:44 AM

If you need an embedded database, you should consider the SQL Server 2005 Compact Edition because it might be the better choice over the SQL Server 2005 Express Edition. The Compact Edition is not a released product yet, but is at the release candidate stage. With the price point of being free, it becomes a relative "no brainer" solution when you need a small embeddable database on the client side for your applications.

I should also make one last comment &md; MSDE won't be supported on Vista. If you are still using MSDE, then you might want to start seriously considering SQL Server 2005 Express Edition or Compact Editions

solution  solution

06-Oct-08 06:59 AM

Hi,

Someone with administrator privileges on the machine, would need to sign in the SQL Server Express and add you as a member of the sysadmin server role.  You would then be a "SQL Administrator" and perfrom below tasks.

1. If you don't have a database, you must create it on local computer in Visual Studio (Add new item to App_Data directory) or in SQL Server Management Studio (Create database). Before you copy this file you must detach your database from your SQL Server.

2. You must be sure, when you copy the .mdf file(s), don't copy the log files to the FTP. (If you did, then you must delete them). All databases files must be placed in the App_Data directory.

3. On the freehosting server you can use User Instances only.

4. You may have to remove the LocalSqlServer name:

Code:
<remove name="LocalSqlServer"/>

5. You must generate connection string using Connection String generator from freehosting administration. Just click to edit freehosting and on the bottom of the edit page you can find this generator.

Connection string should be:
Code:
<connectionStrings>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;Database=dotnet35.qsh.eu_3beface2-2168-419f-847e-e0c9d1c951cc;AttachDBFilename=|DataDirectory|database.mdf" />
</connectionStrings>

Database=dotnet35.qsh.eu_3beface2-2168-419f-847e-e0c9d1c951cc - must be unique name on the server, like hostname_generatedGUID

6. It is not possible to use standard database server and administation tools at http://mssql2005.qsh.eu/ - myLittleAdmin, myLittleBackup and Web Database Diagram Manager. Those tools are only for managed hosting programs. See http://forum.qsh.eu/Default.aspx?g=posts&t=60 for details.

Regards,
Megha
hi thanks  hi thanks
06-Oct-08 07:58 AM

i configured my express to login as suggested from the site and create user name and password but got this error

Cannot connect to SUNI\SQLEXPRESS.

===================================

A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (.Net SqlClient Data Provider)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=233&LinkId=20476

------------------------------
Server Name: SUNI\SQLEXPRESS
Error Number: 233
Severity: 20
State: 0


------------------------------
Program Location:

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
   at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32 bytesExpected)
   at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
   at System.Data.SqlClient.TdsParserStateObject.ReadByte()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server)
   at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

 

reply  reply
06-Oct-08 08:47 AM

The MS links says: Do below

Explanation

The SQL Server client cannot connect to the server. This error could occur because the server is not configured to accept remote connections.

   
User Action

Use the SQL Server Surface Area Configuration tool to allow SQL Server to accept remote connections. For more information about the SQL Server Surface Area Configuration Tool, see Surface Area Configuration for Services and Connections.

Also see below links to configure the server to allow remote connections:

http://support.microsoft.com/kb/914277

http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

http://www.specifysoftware.org/specifyforums/procedures/sql2005RemoteConfig

Regards,

Megha

yes i succeed  yes i succeed
06-Oct-08 11:47 PM
hi thank you so much for ur valuable suggestions. i could now login as sql server authentication. but for embedding i am getting the same error...i couldnt connect to sqlexpress from the downloaded code and failed to attach northwnd db. i didnt install sp2 with sqlserver 2005 express edition...is it must to install
reply  reply
07-Oct-08 12:12 AM
You have to install SP2 otherwise how you would manage the all services? Please see http://www.microsoft.com/downloads/details.aspx?FamilyId=5b5528b9-13e1-4db9-a3fc-82116d598c3d&displaylang=en which tells you why and how you can install sp2 service pack.

Regards,
Megha
hallo is this is enough  hallo is this is enough
07-Oct-08 02:22 AM

i am using windows xp with service pack 3 and

Microsoft SQL Server Management Studio Express      9.00.3042.00
Microsoft Data Access Components (MDAC)      2000.085.1132.00 (xpsp.080413-0852)
Microsoft MSXML      2.6 3.0 6.0
Microsoft Internet Explorer      6.0.2900.5512
Microsoft .NET Framework      2.0.50727.42
Operating System      5.1.2600

regards,

Suny

yup..its fine  yup..its fine
07-Oct-08 02:33 AM
end of post
hai it was version problem..  hai it was version problem..
07-Oct-08 03:21 AM

First i create a back up data of Northwind from my sql 2000.then i create a database named Northwind in my sql express edition. then restore that from the backup data of Northwind database. after that i detach it. So I could succeed attaching that through my vb application

this is the code:

 cn.ConnectionString = "Provider=SQLNCLI.1;Integrated Security=SSPI;Server=SUNI\SQLEXPRESS;" & _
        "Persist Security Info=False;User ID=sa;Password=holsoft;Database=Northwind; " & _
        " AttachDBFileName=" & App.Path & "\Northwind.mdf;"

cn.Open

But my doubt is when i try to installe my exe in clients system..should i manaully create the Database in his system.and should i install sql express seperately...

I found in MSDN that Sql express installation can be done through Custom application

Is these three methods are enough for embedding

IsExpressInstalled, EnumSQLInstances, and InstallExpress these

or should i manually do it all

please give my suggestions

regards

Suny

 

 

suggestion  suggestion
07-Oct-08 03:37 AM
If you can do manually then it will be better or using methods also ok. Do your works and if you find any difficulties then let me know.
Create New Account
help
Can't get Sql Server 2005 to install and start SQL Server I am trying to install Sql Server 2005 to my Laptop and it seems to install but it can't start the Product : SQLXML4 Product Version : 9.00.1399.06 Install : Successful Log File : C: \ Program Files \ Microsoft SQL Server \ 90 \ Setup Bootstrap \ LOG \ Files \ SQLSetup0006_CATH-SATELLITE_SQLXML4_1.log - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - Machine : CATH-SATELLITE Product : SQL Server
MS SQL ? SQL Server I've always thought that SQL was associated with databases? I have the following on my machine. . . Microsoft SQL Server 2005 Microsoft SQL Server Native Client Microsoft SQL Server Setup Support Files (English) Microsoft SQL Server VSS
Any ideas? New to SQL & installing ACT - why does the install fail? SQL Server Microsoft SQL Server 2005 9.00.3042.00 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = OS Version : Microsoft Windows XP Home Edition Service Pack 3 (Build 2600) Time : Sat Dec 26 22:38:29 2009 Machine : D89YH1G1 Product : Microsoft SQL Server Setup Support Files (English) Product Version : 9.00.3042.00 Install : Successful Log
MSDE on Windows 2003 R2 box, new DL385G6 - Install Fails during SQL Services SQL Server I have been finding that I am having trouble with the Crystal Reports Server XI installation failing when it is dealing with SQL. So, as a thought and in case there was something wrong with my SQL portion of the isntall. I thought ok, I will try installing the actual MSDE application direct from Microsoft. So, I downloaded the MSDE for SQL 2000 (which is msde2000a.exe), set my switches and off to the races. It quit
SQL Express: Failed Reinstall SQL Server Dear Setup Experts: I am trying to reinstall SQL Express after playing with it some. I uninstalled it, and now, it refuses to reinstall in the face. Any ideas what this log file means and how I can get SQL Express installed? I really do not want to have to reinstall my whole system. * ** ** Start of Log File Overall summary: Final result: SQL Server installation failed. To continue, investigate the reason for the failure, correct the problem, uninstall SQL Server, and then rerun SQL Server Setup. Exit code (Decimal): -2068643839 Exit facility code: 1203