Click here to Skip to main content
15,896,730 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
When i add data to a gridview how do i make the data stay there permanently until i remove it, so even when i open and close the form the data doesn't get deleted. im using it as a database for a login system

Imgur: The magic of the Internet[^]

What I have tried:

dataGridView1.Rows.Add(Usertxt.Text, Passtxt.Text, 1 , PrivelegeCB.Text);
Posted
Updated 15-Aug-20 19:54pm
v4
Comments
[no name] 16-Aug-20 6:19am    
Here you find an example in accepted solution: c# Save DataGridView to Xml file - Stack Overflow[^]
Richard Deeming 17-Aug-20 11:53am    

1 solution

You have to add it to whatever backing store you are fetching the rest of the data from: your Database, config file, CSV, XML, JSON, or Excel file for example.

We have no idea where the rest of the data in your DGV comes from, so we can't give you specific help.
 
Share this answer
 
Comments
vikil chandrapati 16-Aug-20 1:51am    
the data comes from a textbox that i enter the data into, i put in an image of the layout
OriginalGriff 16-Aug-20 2:18am    
:sigh:
No, the *rest* of the data in your DGV, not the one new row.

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