How Do I Create A Database During Installation Of My C# Desktop Applicaton?
Nov 24, 2006
Dear all,
I have developed a C# desktop application which uses SQL express as its database. It works just fine as I installed the application, used SQL express Server Management Studio CTP to create database with tables , stored procedures etc.
Now, I want to create an installer that will not only install my application to other machines but also create the database with all the tables and stored procedures with it.
How do I do so? I searched the answer in several places but none worked out for me. Can anyone please help me on this??
For your convenience I'm giving the following informations:
Database name: NorthPoleSQL sever Name: IshtiaqueSqlexpress (used Windows Authentication Mode)
I have detached the database from the original machine and have the NorthPole.mdf and NorthPole_Log.ldf files. I want to use these files and create the database in target machine rather than writing sql scrips and executing them.
Please help me with a descriptive, step by step instruction as I am new to this technology.
Thank you.
I have searched through this forum and the news group
microsoft.public.sqlserver.ce
for this topic. I only find a post from Darren Shaffer and I requested a document.
Unfortunately, there is not a clear example of how to create a mobile database (sdf) on a desktop machine which contains VS 2005 and SQL server 2005 by using Visual Basic 2005.
I am sure a clear example in VB for this problem would help a lot of people. Hence anybody who knows how to perform this task, Please help these people.
I am trying to use msde for the startup kits. but i cannot connect to it. How can I do a simple test to verify it is installed and that I can log into the db?
I have SQL Server 2000 installed on my laptop and am trying to install an instance of MSDE. I keep getting the error message: "The installation of SQL Server 2000 Desktop Engine has failed. Please see the Getting Started manual for further instructions."
I have done this installation before on other machines. Something must be corrupt on my machine (?). The error message is not very enlightening. Any ideas?
There are special instructions for installing service packs on desktop edition installations -- command line options etc. How do you install hotfix roll-ups? Does build 2187 apply to desktop edition?
During installation of MSDE the installation hangs at "please wait while Windows configures microsoft sql server desktop engine" I always end up killing the installation process. I am trying to install Windows XPe dev kit and this is the step I am getting stuck on. If I try to skip this step and setup the database the setup obviously tells me that i dont have sql 200 or MSDE installed.
The KB article http://support.microsoft.com/kb/811479 describes the syptoms perfectly, but fast user switching isnt even enabled for this machine and is not the source of the problem.
Respected Sir this thing I knew 2 year later, unfortunately forget and missplace
I want to not depend on sql server 2000 clients , can I include some dll s in my vb6 setup sothat I may not depend on sql server client to install all my clients I want to add dependancy files of sql server in my deployment setup of application written in vb6 ans sql server plz help me Can anybody provide liste of these files
Dear All, i have a question abt winCE 4.2 and SQL server CE. i am using VB.net of Visual Studio 2005 My platform is using a PDA with winCE 4.2 and SQL server CE. The Host program is using dbf files on desktop side.
I got a problem of how to sync / read the sql CE data from a windows application.
so, i wanna ask,
1. any method to access the data from winCE data by windows application? or can i convert the sdf file to windows readable files? or any others?
2. Can i use a MDB to sync with SQL server CE? can i synchronize the mobile device which has a SQL Server CE database with the Access database on the desktop?
last question, 3. is that windows CE .net 4.2 not support pocket access (cdb) anymore?
Hi, I would create a vb2005 application that allow me to edit a sdf database stored into a pda connected at pc with activesyn directly on my desktop as well as "SQLCE Database View". How can i do it??
I hav emulator Windows CE 4.0 with Visual Studio 2003, C#.
I want connect to sql server 2000......after read all posts of this subject and try all varieties modes of connecting string.....in sql profile i see that application in emulator try to connect the sql server but i have the same exception :
I am dealing with an old ASP.NET 1.1 web app that I want to fix and update. The existing site has an SQL database on the web host's SQL server. I want to rip a complete copy of this database (it isn't large, only 9MB) onto my desktop computer, so I can alter it and "bench test" the changes I'm making to the overall application in VS2005.
Now, I have tried to yank a copy of this database and its structure using GUI programs like Visual Studio 2005, SQL Studio Manager Express, and EMS SQL Manager, none seem to offer a "Save As" option. While I can easily make changes to the database and its tables on the web host's server (sql.hostname.net) with no problem, I can't figure out how to pull a copy off of their server and onto my machine...
Does this problem have a very simple solution that I am overlooking?
I am thinking of using my web database as the database to use for my program, though not sure how feasible due to connection speeds and having to transfer that info.
what I am using as the connection string is
con.ConnectionString = "Data Source=databse ipadress inserted here; Initial Catalog=databasename here;Integrated Security=True"; with real data obviously inserted into the ip and tables, but when i try and send values there it just hangs and then crashes. I am thinking its not finding the database. Is there something else im to do?
I am using the exact same code as when i use my own machine as the server, and it works great that way, only thing different is the trying to send to the web server.
I am running 7.0 standard desktop on Workstation 4.0 and have run into a database size limitation of 10GB. I have all the newest patches and have found no documentation that refers to a 10GB limitation. A September copy of VBA developer says that this edition has a limitation of 4GB while the guides say that the Small Business Server edition would have a 10GB limitation. All other forms of documentation say that there should be the standard mega-terabyte limit. I'm completely confused by this [lack of] documentation. Any help???
I want to physically move my .SDF file to my desktop and then access this file from VS 2005 VB.NET. Ideally, I would want to access this .SDF file from MS Access 2003 but I undersand this is not possible.
Here are my VS 2005 VB.NET statements....
Dim ConnPPC As New System.Data.SqlClient.SqlConnection("Data Source = C:Documents and SettingsG014436My DocumentsSQL
MobileActMgr6CE.sdf")
Dim mySqlDataAdapter2 As New SqlDataAdapter("select * from T0002_AE_Activity_Entry", ConnPPC)
mySqlDataAdapter2.Fill(myDataSet2)
On executing the last statement(fill)...I get the following error.
function failed: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
The sample application provided with Access Database Synchronizer fires a "A request to send data to the computer running IIS has failed. For more information, see HRESULT." exception on my WinCE 4.2 device.
I debugged it with VS2005 to see what was going on and found that the problem resides in the line:
m_connDesktop.Pull("MSysObjects","SELECT Name FROM MSysObjects WHERE Type=1 and flags=0",accessSysConnectString,RDATrackOption.TrackingOff,"Err_MSysObjects");
It seems that connection m_connDesktop is ok but calling Pull method fails.
I've verified that SSEvAccessSync service is started when ActiveSync detects device connection and that firewall rules are correctly updated.
Also, i verified my System.mdw and i discovered that there is no "MSysObjects" table (only MSysGroupList, MSysGroupMembers, MSysUserList and MSysUserMemberships queries are there).
Do you think the problem is there?
How can i solve it without damaging System.mdw?
I cannot figure out what's the purpose of this line of code, can you help me?
I am writing a Desktop application accessing a SSCE database. I am running Windows XP SP2, VS2005 SP1, and have SQLServerCE3.1 installed. Debugging the application shows that ds.m_spInit->QueryInterface() returns E_NOINTERFACE. I have checked that SSCE runtime library is installed, IDBCreateSession uuid exists in the registry and m_spInit.CoCreateInstance(CLSID_SQLSERVERCE_3_0) return S_OK. Can you suggest me what need adding/installing to get the CSession.Open(datasource) working?
I am developing an application for a Pocket PC (PPC). I am using Visual studio 2005, and the Operating system on this PPC is Window Mobile 2003 SE. The followings are my codes to connect PPC with the database on my PC with sql server 2005. But when I cick the button1, the error with "SQL Server does not exist or access denied." Any ideas? Thanks a lot.
Imports System.IO
Imports System.Data
Imports System.Data.SqlClient
Imports System.Math
Imports System.Drawing
Imports System
Public Class Form1
Dim strConnection As String = "Server=localhost;Integrated Security=SSPI;database=AdventureWorks"
Dim strQuery As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = "Hello, Clicking after."
ReadOrderData()
End Sub
Private Sub ReadOrderData()
Dim queryString As String = "select * from Person.Address where AddressID < '10'"
Using connection As New SqlConnection(strConnection)
Dim command As New SqlCommand(queryString, connection)
connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
Actaully i want to install SQL SERVER 2005 Enterprise edition in the silent mode and I was tyring to create a response file (setup.iss), but from the document provided i saw that SQL SERVER 2005 Enterprise edition doesnt create response file, and doesnt support setup.iss. So please provide me some solution where i can generate response file or some thing which is similar to that.
I have a clustered server environment where three of the SQL Server local groups were not created during installation. One of these missing groups is SQLServer2005SQLAgentUser$ComputerName$InstanceName, and this is causing problems with trying to automate replication.
How do I create this group after I have installed SQL Server?
Can I dynamically (from a stored procedure) generatea create table script of all tables in a given database (with defaults etc)a create view script of all viewsa create function script of all functionsa create index script of all indexes.(The result will be 4 scripts)Arno de Jong,The Netherlands.
I have some code that dynamically creates a database (name is @FullName) andthen creates a table within that database. Is it possible to wrap thesethings into a transaction such that if any one of the following fails, thedatabase "creation" is rolledback. Otherwise, I would try deleting on errordetection, but it could get messy.IF @Error = 0BEGINSET @ExecString = 'CREATE DATABASE ' + @FullNameEXEC sp_executesql @ExecStringSET @Error = @@ErrorENDIF @Error = 0BEGINSET @ExecString = 'CREATE TABLE ' + @FullName + '.[dbo].[Image] ( [ID][int] IDENTITY (1, 1) NOT NULL, [Blob] [image] NULL , [DateAdded] [datetime]NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]'EXEC sp_executesql @ExecStringSET @Error = @@ErrorENDIF @Error = 0BEGINSET @ExecString = 'ALTER TABLE ' + @FullName + '.[dbo].[Image] WITHNOCHECK ADD CONSTRAINT [PK_Image] PRIMARY KEY CLUSTERED ( [ID] ) ON[PRIMARY]'EXEC sp_executesql @ExecStringSET @Error = @@ErrorEND
I'm new to using SSIS and have been reading and learning slowly how to use it. I'm trying to create an identical copy of our database for reporting. I've used the Import/Export wizard, but have had some issues with foreign keys and with sql_variant columns.
I've tried searching for anything but haven't had any luck as of yet. I guess I don't even know where to start or what to look for.
I have installed SQL Sever 2000 on my Windows XP Pro machine from theEnterprise Edition setup and it prompts you that only the client toolscan be installed. I wanted to have a local database as well So whatinstall should I have used to do so. Any information would greatly beappreciated.
I am trying to run one SQL Express database for two separate applications that will also use the Membership framework. My database is set up fine and works between both applications 100% as needed with the exception of Membership which I am fairly new to.
From my understanding given the following link http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/PAGHT000022.asp I need to install membership on the database. So I did the following
(allow remote connections with TCIP/IP and named pipes) Started SQL and even re-booted Ran: aspnet_regsql.exe -E -S localhost -A m I even tried to run it by replacing localhost with MSSQL$SQLEXPRESS
All attempts gave me an error saying it could not connect and most likely because remote connections is disabled.
I think the reason for all this is because I don’t actually have the “real� IIS installed but rather I am using the instantiated version that automatically comes up when starting a ASP.NET 2.0 application.
I am assuming I need to set everything up such that I am using the real IIS rather then the default one in visual studio.
I was wondering if someone could help me. I need to re-install the SQL Server (due to a registry corruption). What I plan to do is to:
- Detach all databases (including master, pubs, and tempdb) - Copy databases to a different folder - Uninstall SQL Server - Reinstall SQL Server - Copy the databases back - Reattach all databases
Will that preserver all the security? (e.g. syslogins and sysxlogins) Will using an old "master" database on a new install pose any problems?
Any help will be GREATLY appreciated. Please email me at vchai@artinmotion.com
Hello, I am very new to SQL Server. I have downloaded the SQL Server 2005 Express from microsoft's website and installed it on Windows Vista. I have also downlaoded the sample databases like pubs, northwind from http://www.microsoft.com/downloads/details.aspx?FamilyId=06616212-0356-46A0-8DA2-EEBC53A68034&displaylang=en and adventure works from the respective site. When i try to run the script of pubs and northwind, it generates error messages and it is as follows: Msg 911, Level 16, State 1, Line 2 Could not locate entry in sysdatabases for database 'pubs'. No entry found with that name. Make sure that the name is entered correctly. Msg 262, Level 14, State 4, Procedure sp_dboption, Line 0 SHOWPLAN permission denied in database 'master'. Msg 262, Level 14, State 4, Procedure sp_addtype, Line 0 SHOWPLAN permission denied in database 'master'. Msg 2715, Level 16, State 7, Line 2 Column, parameter, or variable #1: Cannot find data type id. Msg 2715, Level 16, State 7, Line 2 Column, parameter, or variable #1: Cannot find data type tid. Msg 2715, Level 16, State 7, Line 2 Column, parameter, or variable #1: Cannot find data type id. Msg 2715, Level 16, State 7, Line 2 Column, parameter, or variable #6: Cannot find data type tid. Msg 2715, Level 16, State 7, Line 2 Column, parameter, or variable #1: Cannot find data type tid. Msg 2715, Level 16, State 7, Line 2 Column, parameter, or variable #1: Cannot find data type empid. Msg 8197, Level 16, State 4, Procedure employee_insupd, Line 2 The object 'employee' does not exist or is invalid for this operation. Msg 208, Level 16, State 1, Line 2 Invalid object name 'authors'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'publishers'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'pub_info'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'titles'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'titleauthor'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'stores'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'sales'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'roysched'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'roysched'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'roysched'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'roysched'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'roysched'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'roysched'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'roysched'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'roysched'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'roysched'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'discounts'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'jobs'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'employee'. Msg 208, Level 16, State 1, Line 2 Invalid object name 'employee'. Msg 208, Level 16, State 1, Procedure titleview, Line 4 Invalid object name 'authors'.
I think thess errors are mostly due to windows vista's new security features at the user level. However, I using my home computer and the admin privileges and in this case I shouldn't have any problem running it unless there's anything to be done on vista to work this. I'll appreciate if anyone helps me installing the sample files. Thanks in advance.