C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




help me very urgent..


Posted Date: 29 Aug 2008      Total Responses: 2

Posted By: banu       Member Level: Silver     Points: 1


i want to copy one table data to another table in asp.net coding how to write please tell me..this s my coding i dont know whether its rite r wrong..help me frinds..






Responses

Author: ANIL PANDEY    29 Aug 2008Member Level: DiamondRating:     Points: 6
hi,

if the structure of the table is same u can use the Following query

insert into tabname values(Select * from tab2name)


u can try this instead of this


string str;
lblUsrNme.Text = Session["LoginUserName"].ToString();
SqlConnection objcon = new SqlConnection("Data Source=VEESERV;Initial Catalog=jobsite;User ID=sa;Password=sa");
objcon.Open();
SqlDataAdapter c1 = new SqlDataAdapter("Insert into JB_appliedjob(username,Email,Contactaddr,Mobileno Experience) values select username,Email,Contactaddr,Mobileno,Experience from JB_Profile where lblUsrNme.Text='" + lblUsrNme.Text + "'", objcon);
MsgError.alert("Applied Successfully");
objcon.Close();


Thanks
Anil



Author: Praveen    29 Aug 2008Member Level: GoldRating:     Points: 4
SqlDataAdapter c1 = new SqlDataAdapter("Insert into JB_appliedjob(username,Email,Contactaddr,Mobileno Experience) values select username,Email,Contactaddr,Mobileno,Experience from JB_Profile where lblUsrNme='" + lblUsrNme.Text + "'", objcon);
Hey Remove .Text at your Query


Post Reply
You must Sign In to post a response.
Next : urgent please
Previous : Query Problem
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

silicone halloween mask

Contact Us    Privacy Policy    Terms Of Use