JasonSummers
Programmer
I have a Listview control on my form that is filled with data from a table (Main_Table). Right clicking a row on the listview opens up a form (my edit data form))with data fields (connected to a dataset ) for editing. I pass the 'Task Number' (the record number or item number) value to this form and I would like the value passed to a parameter I have in my fillby query. I created by fillby query by right clicking the tableadapter>Add Query. The Query looks like this.
SELECT Item_No, Item_Name, Item_Description, Priority, Percent_Complete, Closed, Reference_Information, Date_Initiated, Date_Required, Date_Statused, Date_Completed, Primary_Contact
FROM Main_Table
WHERE (Item_No = @TaskNumber)
On my data entry form load event I would like to pass the TaskNumber string into this query as follows, but I do not understand the available documentation on about parameters.
private void DataEntry_Load(object sender, EventArgs e)
{
this.main_TableTableAdapter.FillBy(this.dsdworgDataSet.Main_Table,TaskNumber);
}
How do I use the parameter in the query? This does not work. Also, why does everyone use the @ sign when working with parameters? I'm so confused.
Thanks for your help.
Jason
SELECT Item_No, Item_Name, Item_Description, Priority, Percent_Complete, Closed, Reference_Information, Date_Initiated, Date_Required, Date_Statused, Date_Completed, Primary_Contact
FROM Main_Table
WHERE (Item_No = @TaskNumber)
On my data entry form load event I would like to pass the TaskNumber string into this query as follows, but I do not understand the available documentation on about parameters.
private void DataEntry_Load(object sender, EventArgs e)
{
this.main_TableTableAdapter.FillBy(this.dsdworgDataSet.Main_Table,TaskNumber);
}
How do I use the parameter in the query? This does not work. Also, why does everyone use the @ sign when working with parameters? I'm so confused.
Thanks for your help.
Jason