Visual Studio .NET - Create SQLEXPRESS dbase and add tables programmaticly in Visual Basic Express

Asked By Ger F. on 03-Apr-10 06:00 AM
Who will and can help me to start create programmaticly in Visual Basic 2010 Express a database whith 4 tables.
I know how I can make a dbase with the Database Explorer.

Thanks in advance!
sri sri replied to Ger F. on 03-Apr-10 06:09 AM
hi,

create a sql script for creating tables

and run that script from the frontend
Ger F. replied to sri sri on 03-Apr-10 06:20 AM
Sri Sri thank you for your answer.
Yes I know that I can make a database with a sql script, but I like to make the dbase inside my Visual Basic program.
Maybe you know ho to do.

Thank you Ger
 
Anoop S replied to Ger F. on 03-Apr-10 06:22 AM
for creating database programmatically
1.for ms access
http://www.freevbcode.com/ShowCode.Asp?ID=5797
2. for sql server
http://www.vbdotnetheaven.com/UploadFile/mahesh/CreateSQLDatabase04252005064419AM/CreateSQLDatabase.aspx

to make database with database explorer

click-> View...Other Windows...Database Explorer. Then you can right click on Data Connections in the Database Explorer window and select Add Connection.
To add a data source click Data...Add New Data Source...click Database in the Data Source Configuration Wizard, Next button, DataSet as the data connection and then the New Connection... button. If the Data Source in the Add Connection dialog is not Microsoft Access Database File (OLE DB) then click the Change... button. Then select Microsoft Access Database File from the Change Data Source dialog and then click the OK button.
Ger F. replied to Anoop S on 03-Apr-10 06:48 AM
Hello Anoop S,

Thank you for your detailed message.
I will try with your choice 2. I like to make a sqlExpress dbase programmaticly.
Normaly I work fine with the database explorer, but I need to export the program to other standalone computers and depend the computer I need to change the tables.
If you know a explanation on a site thats for SQLEXPRESS, please send me that URL 

Best regards, Ger
Anoop S replied to Ger F. on 03-Apr-10 08:04 AM
you mean database path?
try this one
http://www.homeandlearn.co.uk/csharp/csharp_s12p3.html
Everithin is OK
Ger F. replied to Ger F. on 03-Apr-10 02:24 PM

Hello Anoop S,

I have finished my program and everything goos good.
Thank for your graet help.

Till my next problem, Cheers Ger