February 19, 2009 at 3:13 pm
Hi,
I am using DAAB 4.1 into my project to work with my SQL Server 2005 DB.
Now i am in requirement of creating table at runtime to the DB. i need to use DMO but there is ambiguous namespace exist with them.
Is there a possibility of using SMO and DAAB together? if yes then how?
Thanks
Syed
February 19, 2009 at 3:35 pm
Table at runtime it is better to use DAAB because you can create tables, Database and other objects with ADO.NET ExecuteNonQuery. The reason if you had used DMO to create table at runtime it may not be long before you cannot use it but any ADO.NET code can be used with any RDBMS.
Kind regards,
Gift Peddie
February 19, 2009 at 3:55 pm
Is it possible to pass a table name as argument into the stored procedure?
All i need is to create a table dynamically into the SQL server 2005 from my application?
Could you please send me some sample script to accomplish this.
Thanks,
Syed
February 19, 2009 at 4:04 pm
No if that is what you want then you may need SMO I am talking about creating new table and other objects in ADO.NET.
http://functionx.com/csharp1/adonet/Lesson04.htm
Kind regards,
Gift Peddie
February 19, 2009 at 8:25 pm
Thanks Gift for all the suggestion but that doesn't solve my problem.
I am thinking of using SELECT INTO...but the problem is that it copies the data also.
is there any way i can just copy the structure of the table using SELECT INTO....
SMO is the perfect option but as i am using DAAB in most part of my application and
DAAB Database object get collides with the Microsoft.Sqlserver.Management database object.
and i am in no mood of changing my rest of the code from DAAB to SMO thats why i am looking
for an alternative...
Please suggest something which can be possible with the use of DAAB 4.1 or with the use of unity block 4.1.
Thanks,
Syed
February 19, 2009 at 8:57 pm
Here are two options not using SMO but general ADO.NET not the DAAB you could try both or just use SMO.
http://msdn.microsoft.com/en-us/library/bb675163.aspx
Kind regards,
Gift Peddie
February 20, 2009 at 8:21 am
Thanks Gift,
Your link does provided me some guidence on how to go ahead.
About the SQL server 2008 link :crying: i don't have any plan of going with that.
Thanks,
Syed
February 20, 2009 at 10:56 am
The link you are going to use shows ADO.NET code will work any time because that code was written in 2002. I also thinks you cannot use the SQL Server 2008 code because it takes only input and not output, so use what works.
Kind regards,
Gift Peddie
February 20, 2009 at 11:03 am
I am thinking of using SELECT INTO...but the problem is that it copies the data also.
is there any way i can just copy the structure of the table using SELECT INTO....
SELECT INTO ..... WHERE 1=2
* Noel
February 20, 2009 at 11:53 am
Thanks Noel,
Thats what something i was looking for.
Appreciate your help.
Regards,
Syed
Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply