Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm currently learning the basics of ASP.NET and visual studio 2013. My teacher has given me an assignment to create a basic student registration form and when the student clicks submit, his data should be uploaded to the database.
And also there should be an option to display all the submitted data in a single table in a webpage.
I've created the basic web form but I don't know how to create and connect to a database.
Using PHP, I could create a mysql connection and use sql queries for the rest.
How do I do it in asp.net and sql server?
PS. I'm using sql server 2012 and visual studio 2013 community edition.
Any help would be appreciated.
You have a number of options here. I would recommend based on what appears to be limited experience a tool like Entity Framework https://msdn.microsoft.com/en-us/data/ef.aspx or NHibernate http://nhibernate.info/ would be sufficient. The benefit of these tools is they can actually generate your entire database from your model or vs versa. Nhibernate might be a little more complex for you to setup so I would go with Entity Framework. Google for some samples, there should be plenty!
If you are familiar with PHP a similar such tool would be Doctrine http://www.doctrine-project.org/ which I have used and it is pretty good.
The key really is you need to adjust to a totally new paradigm for development (Unless you have already used OO development within PHP)
Good luck with you development.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
This is a general Umbraco architectural question, not a specific-to-the-line-of-code-question.
I am new to Umbraco but know my way around .net and asp.net mvc well.
For an upcoming project I am considering using Umbraco as a cms but as my experience with Umbraco is little, I cannot quite oversee what my options are when it comes to integrating an already existing mssql database.
The database that will support the Umbraco installation already has some tables present, containing product information. What is the best way to expose this data using the Umbraco api/models and subsequently integrate this data in Umbraco views?
E.g. can I create data models in the Umbraco admin and map those to the existing tables or is there another way that is considered to be a best practice?
Thank you.
I don't have a lot of first hand experience with this subject but I recently did an Umbraco bootcamp that covers exactly this, it's called "Umbraco Application Integration".
The course talks about Route Hijacking and contentfinders for mapping the external data into the umbraco request pipeline.
To call the external tables from you code, you can look into Umbraco's integrated lightweight orm called peta poco, but with a little work Entity Framework or nHibernate can also work.
To intergrate the external tables into you umbraco backend, there's a plugin called ui-o-matic that could help you out
Hopefully this puts you on the right track :)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am new at programming and I want to make an app which uses a SQL Server database. Most important feature of this database must be usable for every computer which has the app installed.
I mean, when I give this app's setup file to another person, this person should be install my app without installing SQL Server program, extra things etc. I don't know it is possible.
I created a database with "SQL Server Object Explorer" inside of "(localdb)\MSSQLLocalDB" but when I tried to add new connection, server name was empty. So I didn't import a database to my project.
So how/where can I create and import a database ?
If you want a local SQL database with your application, that is: data is not shared between devices or users, you'll want something like SQLite which is designed for embedding in distributed applications.
To use it you need to link against the binary and include the binary in your application package. Or, you can use the SQLite team's native C# SQLite library. See here: https://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I create an application using C# and SQL Server database, when I try to create the setup I realized that I need to install SQL Server and create the database in every computer that I install my app on.
Is there any way or software can create the setup with the database without install the SQL server in other computers?
If your storing data locally you are better off to use SQLite (as Flat Eric mentioned, it needs no installation and it efficient on small DB's) then you can just copy the .mdf files instead of having to install the entire SQL server on every machine. Visual Studio provides great functionality to help you set up a LocalDB.
Here are two useful links, They really helped me in these situations:
Upgrade to LocalDB
Creating a Local Database File in Visual Studio
Connecting to Data in a Local Database File (Windows Forms)
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am new to programming in windows environment with Visual Studio most of my work is done in web and PHP .I have to build windows application for a store and the store has to add stock/make bills and sort expired products and the stuff related to stuff so what database backend should i prefer?i thought of microsoft sql but i have to install it on clients system or any simple alternative would be more helpful ?
I asked a similar question here:
Local file-based SQL Server
I had used SQL Server previously, but like you, it had to go onto a client's computer. I'm now using "Microsoft SQL Server Compact Edition (CE)" as suggested in the answer, and this works really well as a standalone database solution.
For deployment point of view I suggest you to use MS Access Database. It is most flexible and simple in use also. Check following link for same
http://office.microsoft.com/en-in/access/
I am using MDB (access database), but for the next project thinking to go for SQLite.
Reason is because MDB access via OleDb is not working in 64 bit applications. You have to compile software as 32 bit, then it will work under 64 bit OS. Or other solution is to install something, called ADE, what will add provider, which solve the issue.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have been using SQL Server 2008 as the database for an windows desktop application. I am re-engineering the product and I might use SQL Server 2008 or MySQL going forward.
So I am thinking of a general solution for archiving. Is there something similar to SqlDump in SQL Server 2008? Presently I am not using an ORM, I might plan to use Entity Framework in the coming days.
Basically I want to remove the old entries and whenever report has to be generated, I have to recover it as well..
Also I have an issue here: what if the database schema changes? How do we restore the old database?
If there is no common solution i would appreciate the solution specific to SQL Server 2008.
The topic of archiving, in general, is too broad for this forum. But I'm going to put in my two cents. I have found that it is best to archive records (i.e. literally move records from one table to another) and oftentimes in a different database.
This handles the schema issue because you can modify the schema of the archive table and keep it in sync.
It also allows you to write specialized reports that actually include archived data as an option.
It further allows you the ability to setup the server architecture for your archive databases differently than your production databases. They don't even have to be on the same server. They don't even have to be linked. Building a .NET application to move rows from one database to another on regular intervals based on your needs would be pretty trivial.