Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need copy table1 data to table table using press button. I am using vb.net 2010 and sql server. Please help me.

This is my own code.but this is not working. Even no error msg. But table data not copy to other table.
VB
Try
    Dim fdee As New SqlCommand("Select no, uname, pword into sum_mnth from loging")

Catch ex As Exception
    MsgBox(ex.Message)
End Try

Thanks
Posted
Updated 9-Aug-13 8:19am
v2
Comments
[no name] 9-Aug-13 14:31pm    
"table data not copy to other table" because you are not doing anything with the command.

1 solution

The reason you did not get any error messages is because your query is not incorrect. It is good. But, it only selects records. It does not copy them into another table.

You need to add on to your sql command.

See this link and look at the part about how do you insert records in a table - see the part on copy data from one table to another:
http://www.paragoncorporation.com/ArticleDetail.aspx?ArticleID=27[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900