Posts

Showing posts with the label mysql-connector

How to handle data that's coming from from database in c#

How to handle data that's coming from from database in c# I think my connection has no problem. But when I run the program and opened browser with this link "http://localhost:1290/bolum/hello" I reached just Output: DKLSAJDKLJALSJDLs Q . How can I use my database data? My model,view,controller files are on the bottom. I removed "using .." lines when writing here. CONTROLLER namespace WebApplication4.Controllers { public class BolumController : Controller { public ActionResult Hello() { var bolum = new Hello() { Ad = "Q" }; Console.WriteLine("success"); MySqlConnection con = new MySqlConnection("server=localhost;database=proje;uid=root;password=123456;"); MySqlDataAdapter da = new MySqlDataAdapter("Select * From hasta_bilgileri", con); DataSet ds = new DataSet(); try{ con.Open(); } catch (...