Click here to Skip to main content
15,913,055 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
Can any one help me how to use the listview control in c#
i want to know how to read the data from the database on to the listview and also changes to be made through listview should updated in database
Posted

I suggest you google this phrase - "winform listview databinding". You'll get almost 51,000 hits. Surely, that's enough hits to be able to cobble together an answer.
 
Share this answer
 
please go through some ASP.NET +
ADO.NET code. i will give you general the steps.
Write user function which will retrieve Values from db and return as data table.

DataTable dt = getDataFromDb();
ListBox1.DataSource = datatable;
ListBox1.DataTextField = dt.Columns[0].ToString();
ListBox1.DataValueField = dt.Columns[1].ToString();
ListBox1.DataBind();


use the control event and set the value to db and call again the above four lines.



the same procedure for data-grid and grid-view

or else visit Data binding a ListView[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900