M
Mike
Have a C# example for async delegate and need to convert to VB. Have
everthing figured out except one statement.
LoadDataSetHandler dl = (LoadDataSetHandler)
((AsyncResult)ar).AsyncDelegate;
The closest i came to it:
Dim dl as LoadDataSetHandler = New LoadDataSetHandler _
(AddressOf (AsyncResults)ar.AsyncDelegate)
Problem with this statement: Comma, ')', or a valid expression
continuation expected.
I've tried several variations but can't seem to get it.
Any thoughts?
Included some more of the C# code just in case
private void AsyncTesterForm_Load(object sender, System.EventArgs e)
{
_ConnectionString = ConfigurationSettings.
AppSettings["Data.ConnectionString"];
_TableNames = ConfigurationSettings.
AppSettings["Data.TableNames"].Split(","[0]);
DataManagement dm = new DataManagement();
LoadDataSetHandler dl = new LoadDataSetHandler(dm.GetDataSet);
AsyncCallback asyncCB = new AsyncCallback(this.DataLoaded);
IAsyncResult ar = dl.BeginInvoke
(_ConnectionString, _TableNames, asyncCB, null);
}
private void DataLoaded(IAsyncResult ar)
{
LoadDataSetHandler dl = (LoadDataSetHandler)
((AsyncResult)ar).AsyncDelegate;
_DataSet = dl.EndInvoke(ar);
MethodInvoker mi = new MethodInvoker(this.UpdateUI);
try
{
this.BeginInvoke(mi);
}
catch{}
}
everthing figured out except one statement.
LoadDataSetHandler dl = (LoadDataSetHandler)
((AsyncResult)ar).AsyncDelegate;
The closest i came to it:
Dim dl as LoadDataSetHandler = New LoadDataSetHandler _
(AddressOf (AsyncResults)ar.AsyncDelegate)
Problem with this statement: Comma, ')', or a valid expression
continuation expected.
I've tried several variations but can't seem to get it.
Any thoughts?
Included some more of the C# code just in case
private void AsyncTesterForm_Load(object sender, System.EventArgs e)
{
_ConnectionString = ConfigurationSettings.
AppSettings["Data.ConnectionString"];
_TableNames = ConfigurationSettings.
AppSettings["Data.TableNames"].Split(","[0]);
DataManagement dm = new DataManagement();
LoadDataSetHandler dl = new LoadDataSetHandler(dm.GetDataSet);
AsyncCallback asyncCB = new AsyncCallback(this.DataLoaded);
IAsyncResult ar = dl.BeginInvoke
(_ConnectionString, _TableNames, asyncCB, null);
}
private void DataLoaded(IAsyncResult ar)
{
LoadDataSetHandler dl = (LoadDataSetHandler)
((AsyncResult)ar).AsyncDelegate;
_DataSet = dl.EndInvoke(ar);
MethodInvoker mi = new MethodInvoker(this.UpdateUI);
try
{
this.BeginInvoke(mi);
}
catch{}
}