maked html page CSS and bootstrap now to connect c# and db.
Please reply step by step.
maked html page CSS and bootstrap now to connect c# and db.
Please reply step by step.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Nov 29, 2023, 9:09 PM
I suggest that you learn Entity Framwork (EF). That will take time to learn but it will save time in the future. Since I use it for ASP.Net applications I have no samples of using a database in ASP.Net applications without EF. I have a simple application that uses SQLite in a WPF application that might help.
You do not say whether you are using SQL Server or some other database. I assume you have already created the database. You will need to have a connection string for the database. The format of the connection string depends on what type of database it is. You can probably use Visual Studio's SQL Server Object Explorer to get the connection string.
The following will read a table from a SQLite database into a
Listcollection whereClipTextis the table name and is also a C# class andDescriptionandDataare fields in the table.I am not sure how to get the data into the HTML withour using EF. As I said, I use EF.
umair mohsinPosted Nov 29, 2023, 7:05 PM
it seems you are at the beginning level of learing aspnet.if so then you should first practice using ado.net as it is the basic tool to connect with your db then move further.there are several ways of connecting your app to db.
Vishal JoshiPosted Nov 28, 2023, 10:09 AM
Hello Krishna
You can create API using .net and call it from the HTML using jQuery Ajax call or you can use a javascript library like angular or react native to call API.
Simple steps you can try:
Thanks
Vishal Joshi
Muzaffar Ur RahmanPosted Nov 27, 2023, 5:12 AM
Hi, could you please find link to connect to DB using C# code.
https://www.c-sharpcorner.com/article/how-to-connect-sql-database-in-asp-net-using-c-sharp-and-insert-and-view-the-data-usi/