ViewData = "Your application description page. MySqlCommand cmd = new MySqlCommand("UPDATE customer SET FullName = '" + FullName + "', CusCode = '" + CusCode + "', Location = '" + Location + "' WHERE CustomerId =" + CustomerId, con) Public IActionResult Edit(int CustomerId, string FullName, string CusCode, string Location) MySqlCommand cmd = new MySqlCommand("select * from customer where CustomerId =" + id, con) reader kiyan ekn aragen eka ececute kranva query eken ena data tika ececute karal eliyata denva MySqlCommand cmd = new MySqlCommand(command, con) Var command = "insert into customer(FullName,CusCode,Location) values ('" + FullName + "' ,'" + CusCode + "','" + Location + "')" Public IActionResult Create(int CustomerId, string FullName, string CusCode, string Location) MySqlCommand cmd = new MySqlCommand("DELETE FROM customer Where CustomerId =" + id, con) MySqlDataReader reader = cmd.ExecuteReader() Ĭustomer.CustomerId = Convert.ToInt32(reader) Ĭustomer.FullName = reader.ToString() Ĭustomer.CusCode = reader.ToString() Ĭustomer.Location = reader.ToString() MySqlCommand cmd = new MySqlCommand("select * from customer", con) Using (MySqlConnection con = new MySqlConnection(connString)) string connString = ("DefaultConnection") function for index page and fetch from db When you make use the configuration service object (your case configuration) you can use the built in section calls, such as GetConnectionStrings () or you can just make an index call configuration 'ConnectionStrings:CRM'. Public HomeController(IConfiguration _configuration)ĬonnString = ("DefaultConnection") The appSettings.json file works similar to how the web.config appSetting section does - there is a key and value pair.
0 Comments
Leave a Reply. |