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
Santosh Kumar
NA
561
2.6m
How I can Use of timer in my code
Jul 17 2013 10:20 AM
Good evening all dear.........
I am using this for copy a table data from one server to another server in sqlserver 2000.
I want this code execute in every 2 minute because source data updated in every 2 minutes and i need to copy new data in every 2 min. I try many but not sucess any, please help me its urgent, Thank you all.
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
SqlConnection source = new SqlConnection("Server = Rajan;User ID=abc;Password=123;Database=Test");
SqlConnection destination = new SqlConnection("Server = santosh;User ID=india;Password=12345;Database=Book");
SqlCommand cmd = new SqlCommand("delete from Book", destination);
source.Open();
destination.Open();
cmd.ExecuteNonQuery();
cmd = new SqlCommand("select * from Test", source);
SqlDataReader reader = cmd.ExecuteReader();
SqlBulkCopy bulkdata = new SqlBulkCopy(destination);
bulkdata.DestinationTableName = "Book";
bulkdata.WriteToServer(reader);
bulkdata.Close();
destination.Close();
source.Close();
InitializeComponent();
}
}
}
Reply
Answers (
1
)
Sort the string names without using any methods in C#?
how to search API data in windows form application?