SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Pls help me for the below scenario
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rsodimba
Starting Member

1 Posts

Posted - 05/10/2012 :  08:46:11  Show Profile  Reply with Quote
Hi,

We are desigining a Web-Site, we are trying a pattren where we prepare the data transfer objects for the tables from ASP page and try calling insert statement by giving the column values. I want to put the insert statement in a single function and passing Transfer Object to this function and here i am giving Insert statement specifying the table name and column values

The bottle neck here is that, since for each table the number of columns will vary and so how can i use a single insert statement so that i can pass all the column values, i have arrived at some logic to get the table name to use, i am actually looking out for something like this

Save (DataTransfer dTO)

{ INSERT INTO TABLE1 VALUES( dTO.column1,...) }

Controller.Save(employeeTO)

Controller.Save(projectTO)

Please let me know if we can know this way...

Thanks,

Ravi Kiran.

DonAtWork
Flowing Fount of Yak Knowledge

2111 Posts

Posted - 05/10/2012 :  09:40:06  Show Profile  Reply with Quote
Try looking at the Microsoft Entity Framework.









How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000