Program4Food
Active member
- Joined
- Nov 22, 2021
- Messages
- 40
- Programming Experience
- 10+
Before I post the question, please keep in mind I am still fresh to C# and am self taught; I came from Visual Basic and got petty good with it but am now transitioning to C#.
So I create a new project in VS2012/DotNet 4.5.1 and try to add an async task, I type it just like examples I am seeing from Google, but no matter where I put the code,
in form.load or a button.press event VS gives me errors, which I *do not* understand so none of it makes sense to me. :-(
I apologize in advance for being a thorn (me) on a rose (this forum) but I really want to get proficient; the only way I know to do that is bang out code and figure out how it works, however when I reach a dead end in my ability to resolve an issue due to limited knowledge and/or ability to comprehend, I have to ask for help.
I have attached a screen shot of the VS error.
So I create a new project in VS2012/DotNet 4.5.1 and try to add an async task, I type it just like examples I am seeing from Google, but no matter where I put the code,
in form.load or a button.press event VS gives me errors, which I *do not* understand so none of it makes sense to me. :-(
I apologize in advance for being a thorn (me) on a rose (this forum) but I really want to get proficient; the only way I know to do that is bang out code and figure out how it works, however when I reach a dead end in my ability to resolve an issue due to limited knowledge and/or ability to comprehend, I have to ask for help.
I have attached a screen shot of the VS error.
All I added to a blank project was async task..:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace createtask
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
private async Task SomeJob()
{
// some work here
}
}
}
}