Saturday, 15 August 2015

mysql - Displaying values from a database on different rows in a textbox C# -



mysql - Displaying values from a database on different rows in a textbox C# -

i've been working on programme pull accounts out of database , display them in textbox got working far pull business relationship database on first row. here code :

string myconnection = "datasource=xxxx;port=3306;username=xxxx;password=xxxx!"; string query = "select * xxx.xxx;"; mysqlconnection condatabase = new mysqlconnection(myconnection); mysqlcommand cmddatabase = new mysqlcommand(query, condatabase); mysqldatareader myreader; datatable dt = new datatable(); seek { condatabase.open(); myreader = cmddatabase.executereader(); while (myreader.read()) { string susername = myreader.getstring("usernames"); string spasswords = myreader.getstring("passwords"); nstextbox1.text = susername + ":" + spasswords; } } grab (exception ex) { messagebox.show(ex.message); }

also there anyway erase old username + password , show new 1 pulled?

like this?:

nstextbox1.text += susername + ":" + spasswords + enviroment.newline;

also, textbox needs multiline.

must textbox? why not utilize listbox?

c# mysql textbox rows

No comments:

Post a Comment