Showing posts with label urgent. Show all posts
Showing posts with label urgent. Show all posts

Friday, February 17, 2012

Create Database with Visual Basic (Urgent)

can i run such a transact SQL script with VB

use master
go
create database Ayhandeneme
on (Name=AyhanDeneme_Dat, FileName='c:ayhandeneme.mdf')
go

Have you tried calling Osql.exe and passing the tsql as a parameter ?|||Yes you can use the TSQL script and run it in VB as a command|||

You cannot execute the GO, as it is a batch seperator defined by the SQL Server tools. You will have to set the context in your connection command, or simply run it in two different batches.

But you should be able to run any T-SQL command from VB.

|||

Use ADO in VB6, ADO.net with VB.net.

As previously mentioned by MSVP, run the db creation in your command text object

Adamus

|||

Ayhan Yerli wrote:

can i run such a transact SQL script with VB

use master
go
create database Ayhandeneme
on (Name=AyhanDeneme_Dat, FileName='c:ayhandeneme.mdf')
go

Wait...you can't USE a db to CREATE a db?

What are you trying to do?

Adamus

Tuesday, February 14, 2012

Create Database models from XML Schema (.xsd)

Hi .Net Guru's,

I have an urgent requirement for my project; the issue is mentioned below;
Using .Net(C#/VB.Net) I need to generate/created Database objects from XML schemas.

I don't have any sample xml schema file to give you.
You just imagine you have a sample .xsd file and this .xsd file will be used to create database tables.

Please let me know if you have any queries.

Thanks,
nick

Hi

You could create a DateSet from visual studio and add some TableAdapters to it VS will generate XSD for you.

And there is a free tool XSD2DB Utilitylets you manage database schemas using XSD files.

Hope this helps.