Click here to Skip to main content
15,888,802 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can I augment an array inside an .exe-file? Pin
Robert Bushlow8-May-20 2:32
Robert Bushlow8-May-20 2:32 
GeneralRe: How can I augment an array inside an .exe-file? Pin
arnold_w8-May-20 3:42
arnold_w8-May-20 3:42 
AnswerRe: How can I augment an array inside an .exe-file? Pin
Eddy Vluggen8-May-20 3:53
professionalEddy Vluggen8-May-20 3:53 
GeneralRe: How can I augment an array inside an .exe-file? Pin
Robert Bushlow8-May-20 4:02
Robert Bushlow8-May-20 4:02 
AnswerRe: How can I augment an array inside an .exe-file? Pin
Richard MacCutchan2-May-20 22:17
mveRichard MacCutchan2-May-20 22:17 
AnswerRe: How can I augment an array inside an .exe-file? Pin
Pete O'Hanlon3-May-20 10:09
mvePete O'Hanlon3-May-20 10:09 
AnswerRe: How can I augment an array inside an .exe-file? Pin
Gerry Schmitz3-May-20 18:54
mveGerry Schmitz3-May-20 18:54 
QuestionAsync await error Pin
Carlos581-May-20 11:01
Carlos581-May-20 11:01 
Hi all!
I've got a Windows Forms (C#) project with a combobox that is populated when the form loads
The problem is that the loading of the combobox is slow, and since the loading is done when the form is trying to display the entire form isn't shown until the combobox have been populated. This can in some circumstances be 20+ seconds.

I've tried the code below, using async and await , but it not works....return error :

"This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread."
Any help will be appreciated....

Thank you...

private async void Form1_Load(object sender, EventArgs e)
       {
           await Task.Run(() =>
           {
               LoadMyCombo();
           });

       }

private async void LoadMyCombo()
       {

           OleDbConnection con = new OleDbConnection(conex);
           string strSQL = "select  * from Customers order by cust_name";
           try
           {

               con.Open();
               OleDbDataAdapter adapter = new OleDbDataAdapter(new OleDbCommand(strSQL, con));
               DataSet ds = new DataSet();
               adapter.Fill(ds);

               mycombo.DataSource = ds.Tables[0];
              mycombo.ValueMember = "code";
               mycombo.DisplayMember = "cust_name";

           }
           catch (System.Exception erro)
           {
               MessageBox.Show("Error.... " + erro.Message);
           }

AnswerRe: Async await error Pin
Mycroft Holmes1-May-20 12:00
professionalMycroft Holmes1-May-20 12:00 
GeneralRe: Async await error Pin
Carlos581-May-20 12:08
Carlos581-May-20 12:08 
GeneralRe: Async await error Pin
Mycroft Holmes1-May-20 12:18
professionalMycroft Holmes1-May-20 12:18 
AnswerRe: Async await error Pin
Carlos582-May-20 4:01
Carlos582-May-20 4:01 
GeneralRe: Async await error Pin
Dave Kreskowiak2-May-20 4:52
mveDave Kreskowiak2-May-20 4:52 
GeneralRe: Async await error Pin
Luc Pattyn2-May-20 9:18
sitebuilderLuc Pattyn2-May-20 9:18 
AnswerRe: Async await error Pin
Gerry Schmitz3-May-20 18:34
mveGerry Schmitz3-May-20 18:34 
AnswerRe: Async await error Pin
Richard Deeming5-May-20 1:16
mveRichard Deeming5-May-20 1:16 
QuestionHow to get a list og Outgoing MSMQ queues (without mention its knowing name) ? Pin
boozeeh11-May-20 5:01
boozeeh11-May-20 5:01 
AnswerRe: How to get a list og Outgoing MSMQ queues (without mention its knowing name) ? Pin
Luc Pattyn1-May-20 7:43
sitebuilderLuc Pattyn1-May-20 7:43 
GeneralRe: How to get a list og Outgoing MSMQ queues (without mention its knowing name) ? Pin
boozeeh11-May-20 12:20
boozeeh11-May-20 12:20 
GeneralRe: How to get a list og Outgoing MSMQ queues (without mention its knowing name) ? Pin
Luc Pattyn1-May-20 13:43
sitebuilderLuc Pattyn1-May-20 13:43 
GeneralRe: How to get a list og Outgoing MSMQ queues (without mention its knowing name) ? Pin
boozeeh12-May-20 1:31
boozeeh12-May-20 1:31 
QuestionUse DLL in C# Pin
Member 1481764029-Apr-20 15:16
Member 1481764029-Apr-20 15:16 
AnswerRe: Use DLL in C# Pin
Dave Kreskowiak29-Apr-20 16:56
mveDave Kreskowiak29-Apr-20 16:56 
AnswerRe: Use DLL in C# Pin
Luc Pattyn29-Apr-20 17:11
sitebuilderLuc Pattyn29-Apr-20 17:11 
AnswerRe: Use DLL in C# Pin
Eddy Vluggen30-Apr-20 9:34
professionalEddy Vluggen30-Apr-20 9:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.