.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

Creating a database installer

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net
 

Hi, I have been reading the below article and I have got it to work.   

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

The problem is when I use my database script file it throws an error 1001 saying error next to keyword 'GO'.    But if i take the exact same script and run it in SQL Management Studio it works fine.

Try this small script, this is what I am using and its giving me an error, An above is a lovely article to creating a database from microsoft.

CREATE TABLE [dbo].[Category](
	[CatID] [int] IDENTITY(1,1) NOT NULL,
	[CatName] [nvarchar](max) NULL,
	[CatDesc] [nvarchar](max) NULL,
 CONSTRAINT [PK_Category] PRIMARY KEY CLUSTERED 
(
	[CatID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[Customer]    Script Date: 10/14/2010 09:52:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Customer](
	[AccNo] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NULL,
	[Name] [nvarchar](max) NULL,
	[Surname] [nvarchar](max) NULL,
	[ID_No] [nvarchar](max) NULL,
	[Address] [nvarchar](max) NULL,
	[Telephone] [nvarchar](max) NULL,
	[Mobile] [nvarchar](max) 


View Complete Post


More Related Resource Links

Creating a database installer using this article from microsoft

  

Hi, I have been reading the below article and I have got it to work.   

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

The problem is when I use my database script file it throws an error 1001 saying error next to keyword 'GO'.    But if i take the exact same script and run it in SQL Management Studio it works fine.

Try this small script, this is what I am using and its giving me an error, An above is a lovely article to creating a database from microsoft.

CREATE TABLE [dbo].[Category](
	[CatID] [int] IDENTITY(1,1) NOT NULL,
	[CatName] [nvarchar](max) NULL,
	[CatDesc] [nvarchar](max) NULL,
 CONSTRAINT [PK_Category] PRIMARY KEY CLUSTERED 
(
	[CatID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object: Table [dbo].[Customer]  Script Date: 10/14/2010 09:52:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Customer](
	[AccNo] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NULL,
	[Name] [nvarchar](max) NULL,
	[Surname] [nvarchar](max) NULL,
	[ID_No] [nvarchar](max) NULL,
	[Address] [nvarchar](max) NULL,
	[Telephone] [nvarchar](max) NULL,
	[Mobile] [nvarchar](max) NULL,
	[Fax] [nvarchar](max) NULL,
	

Data Deployment: Streamline Your Database Setup Process with a Custom Installer

  

Database setup can be a tough and time-consuming process and sometimes fall victim to human error. Microsoft Installer or InstallShield can help, as can your own custom installer. In this article, the author tackles one approach to writing database installers and demonstrates the process with a working code sample.

Alek Davis

MSDN Magazine September 2004


Create user is creating aspxxxx.mdf database in my app_data folder

  

I had already setup roles for my pages and requirements call for ability to manage and create users.

So i was looking at code that allows you to do so using membership, even though i got the page to work, it was creating a database in my app_data folder.. i already have SQLExpress setup with the asp schema, but cant figure out how to get my application to use that instead of creating the db in the folder?

What am i missing or doing wrong?

I have the following setup in my web.config file..

		<authentication mode="Windows"/>
		<authorization>
			<deny users="?"/>
		</authorization>
    <membership>
      <providers>
        <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
        connectionStringName="connectn"
        enablePasswordRetrieval="false"
        enablePasswordReset="true"
        requiresQuestionAndAnswer="true"
        applicationName="MyApplication"
        requiresUniqueEmail="false"
        passwordFormat="Hashed"
        maxInvalidPasswordAttempts="5"
        minRequiredPasswordLength="7"
        minRequiredNo

Creating an database search application in VS C#

  
Hello everyone, I wish to create a C# application that will have a form and a text box where I can enter a text, and then ask the application to search if this text exists in a database. If it exists, I want all the information associated with this text to be displayed in a datagrid view or list box. I am able to create a database in SQL Server and I can connect to my database from VS 2005 C#. If this is possible, how do I go about it? Many thanks in advance.

Creating a .msi installer package for WPF application

  
Hi Frends, I need to create a .msi installer or a setup of my WPF application. ineed to submit tht to my client. i can ask my client to install .net framework 4.0 as a pre requisite but then except that the installer should take care of rest of the things...how can i build such kind of installer or setup. kindly help me as soon as possible pleae coz my project is about to release in a day or so. regards KuldeepRegards Kuldeep Gupta

Creating database throw exception!

  
When running SQL commands, it throws error information. Why is it? My env :    windows server 2003 64bit     sql server 2008 . Command :   CREATE DATABASE [AdventureWorks2009]     ON (NAME = 'AdventureWorks2009_Data', FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2009_Data.mdf', SIZE = 170, FILEGROWTH = 8),     FILEGROUP DocumentFileStreamGroup CONTAINS FILESTREAM ( NAME = FileStreamDocuments, FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents')     LOG ON (NAME = 'AdventureWorks2009_Log', FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2009_Log.ldf' , SIZE = 2, FILEGROWTH = 96); GO     Error information:   Msg 5120, Level 16, State 106, Line 1 Unable to open the physical file "E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents". perating system error -2147024891: "0x80070005(failed to retrieve text for this error. Reason: 1815)".

Cannot see top link bar when creating a Web Database site

  
Hi, I am new to Sharepoint 2010 and am very keen to start using the new Web Database site templates such as Asset Web Database and Issue Web Database. I am able to create these without issue however once i build and navigate to these sites i lose the top link navigation bar. For other sites such as Team Site this is not problem and the navigation site remains. Does anyone have any suggestions on how to show this navigation bar for these site templates?

Error in attaching database file and creating a new connection

  
I am having problem when i was trying to attach .mdf file while create a new connection of SQL server, create a new connection of SQL database file and open the database in Server Explorer. I am using VS 2010 Ultimate and SQL Express 2008 R2.Can anyone please tell me what is the problem I am facing?Here are the error message.1. Attach .mdf in SQL database file and open the database in Server Explorer2. Create a new SQL server and attach .mdf

Creating Database gives error : "Directory lookup for the file "xxxxx.mdf" failed with the operating

  
Hello FriendsI am creating Database using SQLDMOcode is as follows... Code Snippet SQLServer2Class server = new SQLServer2Class();server.EnableBcp = true;server.Connect(WebConfigurationManager.AppSettings["ServerName"] ,WebConfigurationManager.AppSettings["UserName"],WebConfigurationManager.AppSettings["Password"]);DBFileClass dbFile = new DBFileClass();           dbFile.Name = dbName;          dbFile.PhysicalName = "C:\\" + dbName + ".mdf";          dbFile.Size = 300;          dbFile.FileGrowthType = SQLDMO_GROWTH_TYPE.SQLDMOGrowth_MB;          dbFile.FileGrowth = 25;          dbFile.PrimaryFile = true;          LogFile2Class dbLogFile = new LogFile2Class();          dbLogFile.Name = dbName + "_log";          dbLogFile.PhysicalName = "C:\\" + dbName + "_log.ldf";          dbLogFile.FileGrowthType = SQLDMO_GROWTH_TYPE.SQLDMOGrowth_Percent;          dbLogFile.FileGrowth = 10;          Database2Class newDb = new Database2Class();          newDb.Name = dbName;          newDb.FileGroups.Item("PRIMARY").DBFiles.Add((DBFile)dbFile);          newDb.TransactionLog.LogFiles.Add((_LogFile)dbLogFile);          server.Databases.Add((_Database)newDb); This Code Generates Following Error !!]Microsoft][ODBC SQL Server Driver][SQL Server]Directory lookup for the file "D:\Projects\my_system\mySys

Creating table with database data, ASP.net and C#

  
Hi!I just started with my first ASP.net page with C# and I want to create a dynamic table with information from my database. I have connected to the database to the page with datareader, so that is solved. The problem is making the table and import the data into the different rows and columns. I also want the possibility to edit and remove this information from the table. Its supposed to be a table with information about customers.I have no idea whats the best solution for this and I hope you guys got information or links that show how to do this?Regards,fh01

how to attach sql database file to creating .exe setup in c#

  
I create a Setup file and put data folder, in data folder i put database file , but the problem is i have to mannualy attach database file in sql server 2005. I have to automatically attach database file when installing setup file.

Need to restore MDF or LDF file from BAK without creating database.

  
I need to restore the actual MDF or LDF files within a BAK file without creating/restoring to another database. I just need the physical MDF or LDF files only. Is there a way to do this?
What is not explicitly allowed should be implicitly denied

SQL Server 2008: When creating database with filestream group pc hangs

  
Hello,

I am facing this STRANGE problem with sql server 2008. When I try to create a new database with filestream group my system hangs. When I restart pc by direct power off and then on, I cannot see the new database but at the given location I could see that database files and filestream group has been created. 

Solutions Tried.
Uninstall, download new version then reinstall but to no use.
Set maximum permissions to current user (according to my knowledge).
Using Mix mode authentication.


PC configuraion:
XP Home Edition SP2,
Intel Dual Core 2.0 GHZ Processor
4GB Ram,
SQL Server express SP1 installed on NTFS Partition
Plenty of Disk Space
Comodo Firewall pro, Avast Antivirus ( Already tried to stop firewall and antivirus still no use)

Any help would be appreciated.

Creating a SQL Express database

  

The goal is to treat databases like documents:  When the user creates a new 'document', the application programmically creates.  Currently the databse being used is SQLite, we are looking at SQL Express as an option, but we must overcome this hertial first:

Q: Are there any good examples of creating a empty SQL Express database programmatically? 

Sam


(NerdDinner) Creating a New SQL Server Express Database

  

I received an error message like below when Creating a New SQL Server Express Database. any comment would be appreciated.

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

http://content.wrox.com/wroxfiles/aspnetmvc-nerdinner_v2.pdf

ps: Great ASP.NET MVC tutorial! thanks!


creating custom table in share point database in sqlserver is fine ?

  

we are creating custom table in share point database in sqlserver.


is it fine to create custom table?

are we violating any rule  because of the creation of custom table ?

does share point recommended to create custom table  ?


Creating and configuring a Web Application with pre-created content database

  

I recently looked at the very interesting Technet article named "Deploy by using DBA-created databases (SharePoint 2010)"; I've noticed something strange in the following section:

To create and configure the portal site Web application

  1. [DBA] Create the portal site Web application content database using the LATIN1_General_CI_AS_KS_WS collation sequence and set the database owner (dbo) to be the Setup user account.

  2. [DBA] Using SQL ServerManagement Studio, add the service application service account to the Users group and then to the db_owner role for the portal site Web application content database.

  3. [Setup] From the SharePoint 2010 Management Shell, use the New-SPWebApplication and Get-SPWebApplication cmdlets to configure the portal site Web application content database. Use the following example as a guide.

    New-SPWebApplication -Name "Contoso Internet Site" -Port 80 -HostHeader "http://sharepoint.contoso.com" -URL "https://www.contoso.com" -ApplicationPool "ContosoAppPool&q
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend