Hello
I m doing one windows application where i used web browser control,button for connecting URL, textbox for search data in my form. I navigate webbrowser control to one of the dataentry website. I have the data in my database like name, address city, dbo, district etc.
what i m doing i search data from database on name criteria and getting all values in dataset then using 'SendKey' i send that searched data to the particular fields of the website and it works also.The problem is that it works for the textbox control of the website but not for the dropdown control. I used the 'Tab' key for sending data.That website Using Dropdown Control for City,State,Country, Gender etc. Whenever i select some item from dropdown control it postback every time and load page every time. To avoid postbacking and reloading in website i try to make this application.
Below is My COde:
private void fillData()
{
if (dSet.Tables[0].Rows[0]["DistrictName"] != DBNull.Value)
SendKeys.Send(dSet.Tables[0].Rows[0]["DistrictName"].ToString().Trim());
WaitFor();
SendKeys.Send("{TAB}");
SendKeys.Send(dSet.Tables[0].Rows[0]["City"].ToString().Trim());
WaitFor();
SendKeys.Send("{TAB}");
SendKeys.Send(dSet.Tables[0].Rows[0]["SpouseName"].ToString().Trim());
WaitFor();
WaitFor();
GC.Collect();
}
private void WaitFor()
{
for (int i = 0; i <= 5000; i++)
{
Application.DoEvents();
Application.DoEvents();
Application.DoEvents();
Application.DoEvents();
Application.DoEvents();
}
}
Plz help me out what i do for sending data in dropdown control.
Regards
Maahi