Tag: asp.net

restore sql database

I want to restore a database using asp.net web application in C#.. Can anyone help me with this?

SqlDatasource connect to SQL Server 2008 in ASP.NET

I want to use the SqlDatasource to connect a SQL Server 2008, but it says it only support the sql server 2005. Is there any method to solve it? I use the Visual Studio 2008. Best Regards,

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible

I am getting the above error when I upload my app to the hosting company.(asp.net) DB is a local sql mdf in app_data directory. on local asp.net dev server everything is ok. I am using LINQ to SQL Classes, is there anything that can be related to that? Thanks in advance

How to handle Foreign key for optional field in .NET

What is the best way to handle following situation? A dropdown(for master table) is optional in a particular form. But, In database table the field is constrained with foreign key. If user don’t select from dropdown then It creates problem because of foreign key. One solution is to create default option in master table and […]

Why do “I get Failed to generate a user instance of SQL Server” with .NET 4 and not .NET 2?

I have created on my local machine with targetframework 4 in visual studio a simple website using the default template (the one with css problem solved here Google Maps API in ASP.NET Masterpage: why it stays blank?) I uploaded it to my IIS 7 server which was first configured for .NET 2 so in web.config […]

What can I do to use Session on a shared hosting server with load balancing

My website/application is in ASP.NET. I use the traditional Session object when people connect so they have their preference, etc. My problem is that sessions were lost very often. I discovered that my hosting company was using load balancing on their servers, so one request on my website can be on one server, and the […]

Removing Database References from an ASP.NET MVC Site

I’m building a very simple ASP.NET MVC site that doesn’t require a database and doesn’t have user accounts or any other special ASP.NET stuff. When I first created the site with the ASP.NET MVC 1.0 site template in Visual Studio, the web.config page was configured to automatically connect to SQL Server Express as a User […]

Why can’t I create a database in an empty ASP MVC 2 project using Project->Add->New Item->SQL Server Database?

I’m diving head first into ASP MVC and am playing around with creating and manipulating a database. I did a search and found this tutorial for creating a database, however when I follow it, I get this error right at the start when trying to add a new database to my fresh, empty ASP MVC […]

ASP.NET query substring

I’ve got this field in my database year_start_1 and it is an integer field and an example of an ouput is 20100827 I’m trying to create a substring to create year, week, day and change the format to be 27/08/2010 Here’s what i’m trying Dim query as String = “Select * from openquery (devbook, ‘SELECT […]

Generate breadcrumb from database

I have table with data id parent order tab desc ———————————————————————— 1 Null 1 False abcdef 2 Null 2 False efgh 3 1 1 False sadad 4 1 2 False aasd 5 3 1 True qwer 6 3 1 True asdad 7 5 1 False zxzc 8 5 2 False okli This table has data […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.