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) 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'. MySqlDataReader reader = cmd.ExecuteReader() Ĭustomer.CustomerId = Convert.ToInt32(reader) Ĭustomer.FullName = reader.ToString() Ĭustomer.CusCode = reader.ToString() Ĭustomer.Location = reader.ToString() The appSettings.json file works similar to how the web.config appSetting section does - there is a key and value pair. 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 Public HomeController(IConfiguration _configuration)ĬonnString = ("DefaultConnection")
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |