Click here to Skip to main content
14,241,538 members
Rate this:
Please Sign up or sign in to vote.
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.
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
NotPolitcallyCorrect 9-Aug-13 14:31pm
   
"table data not copy to other table" because you are not doing anything with the command.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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[^]
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100