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
raj aryan
NA
26
25.6k
want to export data to the sql server database table
Mar 13 2013 6:02 AM
Hello folks,
I am working on desktop application in c#.net. I have 1 ODBC connection that gives me third party application data into gridview(on 1st button click). Now my task is to dump(export) the data, whatever in the grid, into sqlserver database table(I created the 1 table for sample purpose with the column's name), on 2nd button click. Let me know the procedure in c# to overcome this issue.
here is the code let me know the solution please....
public void export_Click(object sender, EventArgs e)
{
try
{
string connetionString = "sql database connectionstring";
"what to writehere".datasource= model.GetView("Query", txtQuery.Text); //odbc connectionstring
SqlConnection cnn = new SqlConnection(connetionString);
cnn.Open();
string sql = "INSERT Query to get the data from odbc connection and dump the data into sql server database table")";
SqlCommand cmd = new SqlCommand(sql, cnn);
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
}
}
Regards,
Raj
Reply
Answers (
1
)
Need dll file to export to excel with bg images,textbox
memory leakage