Get SQL command from datatable ?  
Author Message
ZopoStyle





PostPosted: Visual C# General, Get SQL command from datatable ? Top

Is there a way to create a sql command to create a table in SQL from a DataTable

And after create insert the data automatically (I'm running foreach row)

But my table is dinamic how can I do this dinamically




Visual C#15  
 
 
Galin Iliev





PostPosted: Visual C# General, Get SQL command from datatable ? Top

I think it is possible but you have to map .NET data types to SQL ones...

by having table created in SQL you could define your select statement and to generate other commands using SqlCommandBuilder Class. I think this is what you want to do...

hope this helps



 
 
ZopoStyle





PostPosted: Visual C# General, Get SQL command from datatable ? Top

Hum...I didn't get..

What I need is to extract/generate the command "Create table dados {.....}" from a DataTable that was create in C#



 
 
dreadjr





PostPosted: Visual C# General, Get SQL command from datatable ? Top

Microsoft has a article on this.


 
 
ZopoStyle





PostPosted: Visual C# General, Get SQL command from datatable ? Top

Ok Thanks