Jfisher387
Member
- Joined
- Dec 14, 2022
- Messages
- 21
- Programming Experience
- Beginner
I am creating a DGV and filling it with data from a dataset. I have done this several times within this application and did not run into the issues I am now. basically the goal is to search through the data for a "Status" of "Active", and then check that the sales rep string matches. once this happens add that data to my list. after it reads through the entire datatable it sets the data source.
my issue is that 3 of the fields are just empty all the way through. I cannot figure out why some display and some do not. I have tried several different approaches with the code to make it work but i just cannot figure it out.
my issue is that 3 of the fields are just empty all the way through. I cannot figure out why some display and some do not. I have tried several different approaches with the code to make it work but i just cannot figure it out.
form load:
private void Active_Jobs_Load(object sender, EventArgs e)
{
//TODO: Highlight due dates that are past due in red, yellow if within 7 days from being due?
this.jobTableAdapter.Fill(this.pRODUCTIONDataSet2.Job);
foreach (DataRow row in pRODUCTIONDataSet2.Tables[0].Rows)
{
if (row["Status"].ToString() == "Active")
{
if (row["Sales_Rep"].ToString() == "JOEDOL")
{
ActiveJobsReport job = new ActiveJobsReport();
job.Order_Date = Convert.ToString(row["Order_Date"]);
job.JobNumber = Convert.ToString(row["Job"]);//
job.Customer = Convert.ToString(row["Customer"]);
job.Part_Number = Convert.ToString(row["Part_Number"]);
job.Description = Convert.ToString(row["Description"]);
job.OrderQty = Convert.ToInt32(row["Order_Quantity"]);//
job.Price = Convert.ToInt32(row["Total_Price"]);//
jobList.Add(job);
}
}
}
dataGridView1.DataSource = jobList;
dataGridView1.Refresh();
}
activejobsreport class:
public class ActiveJobsReport
{
public string Order_Date { get; set; }
public string JobNumber { get; set; }
public string Customer { get; set; }
public string Part_Number { get; set; }
public string Description { get; set; }
public int OrderQty { get; set; }
public int Price { get; set; }
}