UPDATE: think i figured it out. Any extra advice is appreciated.
I've connected to my Database, but now I want to be able to use that data. I want to populate the ListView with the items(LargeIcon/SmallIcon views only) and then be able to click on the items using the SelectedItemsChanged to view them in textboxes and/or be able to update the values.
(ListView displays all data/items on start. User can choose an item. That item holds data. That data is displayed in appropriate controls.)
So i've created another class "UserInfo" to store them in. On my Main Form, I've set up the getter, but I am not sure about how to do the setter.
int row = 0;
public UserInfo userData
{
get
{
string sqltest = data.Rows[row]["occupationId"].ToString();
decimal val;
decimal.TryParse(sqltest, out val);
UserInfo u = new UserInfo();
u.FirstName = data.Rows[row]["firstname"].ToString();
u.LastName = data.Rows[row]["lastname"].ToString();
u.UserName = data.Rows[row]["username"].ToString();
u.occupId = val;
u.ImageIndex = 0;
return u;
}
//Setter
}
Normally you'd have something like thisValue = value.Text
I can't do data.Rows[row]["lastname"].ToString() = value.Lastname
Can i just use string f = data.Rows[row]["firstname"].ToString(); in the setter?
Help appreciated, will edit this as needed.