Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can export data from datagridview to webpage textboxes in c# window application

What I have tried:

Can export data from datagridview to webpage textboxes in c# window application
Posted
Comments
Sandeep Mewara 17-Oct-22 1:15am    
Can you please elaborate on what you are trying to do? Do you own both the webapplication and the windows application? How are you connecting the two here?

High level, sounds you need to extract data out of windows app and put that in a textbox of a webapplication.

People can help you only once you clearly put out the details of what you are doing, what you tried so far and where are you stuck.
Nouman Sahil 20-Oct-22 2:20am    
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
for (int i = 0; i <= 1000; i++)
{
if (backgroundWorker1.CancellationPending == true)
{
e.Cancel = true;
return;
}

System.Threading.Thread.Sleep(1000);
backgroundWorker1.ReportProgress(i);
}
}

private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (System.Windows.Input.Keyboard.IsKeyDown(System.Windows.Input.Key.Down) == true)
{
string cons;
string mob;


foreach (DataGridViewRow item in dataGridView2.Rows)
{
for (int i = 0; i < item.Cells.Count; i++)
{
cons = item.Cells[0].Value.ToString();
mob = item.Cells[1].Value.ToString();
Clipboard.SetDataObject(cons.ToString());
SendKeys.Send("^{v}");
SendKeys.Send("\t");
Clipboard.SetDataObject(mob.ToString());
SendKeys.Send("^{v}");
SendKeys.Send("\t");

}
backgroundWorker1.CancelAsync();
}
}
}

private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (backgroundWorker1.CancellationPending == true)
{
MessageBox.Show("Cancelled");
//progressBar1.Value = 10;
}
else
{
MessageBox.Show("Completed");
}
}

private void btnStart_Click(object sender, EventArgs e)
{

backgroundWorker1.RunWorkerAsync();
}

private void btnStop_Click(object sender, EventArgs e)
{
backgroundWorker1.CancelAsync();

}

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