Coding for an SQL server in a local project - asp.net

I'm coding in ASP.Net on a local machine through visual studio. So when I run the code it starts an ASP.Net service for me.
So now I'm wondering how I setup an SQL server for local development purposes? I need it to have data in it constantly so that when I stop running the ASP page it doesn't just empty.

You should be able to install SQL Express and hook into that. The data will persist in the db unrelated to your asp.net service:
http://msdn.microsoft.com/en-us/library/ms247257%28VS.80%29.aspx

Related

Writes to database seem to have no effect

I am working with an ASP.NET web application written in C# deployed to IIS/Windows Server 2008 R2. The application uses NHibernate to interact with an Oracle database running on a networked unix server.
It seems that writes being made by the application to the database have no effect.
If I manually edit the value of a record in the Oracle database, the new value is reflected by the application. However, if I attempt to change a value using the application’s custom “save” functionality, the changes are not reflected in the database. It seems like reads are succeeding, but writes are failing.
Why do writes seem to be failing?
More information:
No obvious error messages are received (ie. the application does not throw an exception and it seems to continue running as if everything is fine).
Another instance of this application is running on IIS/Windows Server 2003. This instance can write to the Oracle database (ie. the changes can immediately be seen in the database by using a database viewer after clicking “save”).
The code is virtually identical between the 2003/2008 applications. However, on the 2008 server, I am using newer versions of Oracle libraries and I changed to target architecture of the visual studio projects from ‘Any CPU’ to ‘x86’ (the 2008 server is 64-bit while the 2003 server is 32-bit).
Disclaimer:
I have very limited experience working with IIS, NHibernate, Oracle databases, Windows Server 2003, and Windows Server 2008 R2. I do, however, have slightly more experience working with C#, ASP.NET web applications, Visual Studio, and MSSQL databases).
I solved it.
It turns out one of the HttpModules was not being initialized. This was because the web.config file was tuned to IIS6, and the application was running in an application pool set to Integrated Pipeline mode on IIS7. Switching the application pool to Classic mode essentially enabled backwards compatibility.
Anyways, here is the resource that helped me figure it out: httpModules not working on iis7

Publish ASP.NET MVC 4 (Razor) app onto remote server running Windows 7 with IIS 7

I have experience in hosting an Asp mvc 4 application on local IIS with Sql server as back end. Now I want to host this application on another system that don't have Sql server and Visual studio installed. I think we can able to get all files necessary to host by publish option in visual studio 2012. But I don't have any idea on how to make my database working on the server without sql server and the necessary connection strings. Can I change my db to sql server compact 4.0?
Please give the necessary instructions.
For .net Application you can generate necessary files using publish feature of VS.You can even make use of web-deploy for direct deployment of artifacts to remote server itself.
For db you better have sql -engine, without that it get's tricky. Express edition will always be better option if you are not looking for some advanced DBA jobs.

deploying asp.net site on IIS

Okay. Here's my problem.
I have this source code of VB.net + asp.net application which was developed on another computer. It comes with,
database - Microsoft sql .mdf + ita log file
source code of the web application
Now what I want to know is,
Do I need to install Microsoft SQL server to deploy this on IIS?
(I do have Microsoft SQL server management studio express installed on my PC but the thing is I can't connect to database engine of it after installing WAMP.)
Do I have to copy application's database somewhere else to deploy the site?
What are the changes do I have to make in the code to run it properly?
any help would be appreciated!
1) In order for the server to know what the database file (assuming the file is related to microsoft sql) you will need to install microsoft sql on the server.
2) The database should be fine wherever on the server as long as you know where it is.
3) This is a hard question to answer... be more specific?

Hosting an asp website on EasyCgi

I have developed a website using ASP.NET/VB + SqlServer 2008 and Dotnetnuke CMS.
Now I have to host it on easycgi.com
I have some questions:
How should I restore my db (unfortunately easycgi supports just sqlserver 2005) so what should I do to convert my db to 2005?
and what should I do to host my website (step-by-step "please").
Any help appreciated.
Sorry for my english.
Not familiar with easycgi but often times getting SQL Server can be a lot of work. If you can create a database at easycgi the best thing to do is script out your database in SQL server 2008 using this process SQL Server 2008 script data
You'll then have everything for your database in a file. It's scripted and then run that at easy cgi if they have a way to run scripts. Otherwise sometimes you can connect your SQL SErver management studio directly to your database there.
You'll get a temp URL probably at easycgi, make sure that is in PortalAlias table in your SQL Server database.
Update your web.config in two spots to connect to your new database, upload your files to the web server.
Again, never used easycgi, but hope this helps.

Publishing ASP.NET site - No login database?

I have a very simple app on my local machine that uses the ASP.NET membership provider. This works fine on my local machine.
I have published the app to our web server, and I need to know the specifics of setting up the application for asp.net membership to work.
I have a basic understanding that it uses an MDF file and somehow connects to a SQL database (SQLEXPRESS I assume on my local machine) which holds the user/role information.
I keep getting an error that it cannot connect to a SQL database when running the published application on the web server.
I wish to use a SQL server on a different machine (SQL69) than my web server (WEB69)
I have created a new connection string, but how do I tell ASP.NET to use it instead of the "LocalSqlServer" connection string that is created by default?
Can someone explain what is required to me?
Thanks for any help you can offer.
Use the ASP.NET SQL Server Registration Tool without any parameters to set up the SQL Server membership on your local machine. This will also update your config file:
http://msdn.microsoft.com/en-us/library/ms229862%28VS.80%29.aspx
You need to set up SQL Server DB membership on your local machine first. After you have this working, you can simply script the entire DB for your production environment. For this, you can use the Database Publishing Wizard in VS.
You can view a sample config file here:
http://www.codersbarn.com/post/2008/02/24/ASPNET-20-Guest-Book-Admin-Part-II.aspx

Resources