TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
saifullah khan
NA
335
301k
copy data from one table to another in database
Jun 7 2011 1:20 AM
i want to copy all the data from one table to another in database on button click event. here is the code.
protected void Button1_Click(object sender, EventArgs e)
{
con.Open();
cmd = new SqlCommand(" Insert into Consumer(ConsumerNo,ConsumerName,StreetNo,PhaseName,SectorName,PlotSize,DateofConnection,PropertyType,Diameter,Status) select ConsumerNo,ConsumerName,Street,Phase,Sector,PlotSize,DateofConnection,PropertyType,Dia,Status From Table", con);
cmd.ExecuteNonQuery();
}
it gives me the following error:
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'Table'.
please help me out.
Reply
Answers (
3
)
what will be the database size max
How to retrieve all the web services hosted in IIS using ASP.Net