Click here to Skip to main content
15,890,825 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
Hi..

I am facing problem in database connectivity....

I am working in a project in ASP.NET c# .NET 3.5 SQL Server 2005 and Visual studio 2008.

I have developed one Web Application in ASP.NET C# 3.5 framework in Visual studio 2008 and database in SQL Server 2005. I have SQL Server Management Studio Express 2005 in my computer.

I have completed my project and database.

Now the problem arises when I copy my project folder containing-AppData folder..etc..etc. to another computer.

And SQL Server database i created Backup as .bak file.

Now when I came to new computer I pasted the Project folder. I open the project folder with Visual Studio 2008. Program runs fine. But when I double click on any Button or text box, instead of opening in Code page(.cs file), the Button click event is opening in Source page within Script tag.---This is my Problem No.1.

And I restore the .bak file of sql server database.

My project contains connection string in each asp.net page. I change the server name and database name as in New computer.

Now when I run the project my error is giving some instance related error..I tried a lot but could not solve it.

Sqldataadapter da=new sqldataadapted("insert into table name....",con);
Dataset ds=new Dataset;
da.fill(ds)----In this line the error is showing.----This is my Problem No.2


Thanks in Advance for help.
Posted
Comments
CHill60 15-May-14 12:31pm    
"some instance related error" - give exact details of the error
thursunamy 15-May-14 12:35pm    
You may change your connection string on the new computer...
CHill60 15-May-14 12:56pm    
OP claims that they have done that
[no name] 15-May-14 13:05pm    
What is the error message??? "In this line the error is showing" is someting I know from customers...."there is an error", please help....boah

1 solution

Please, read comments to the question. You did not provide enough information to help you. Nevertheless...

I'd suggest you to go back to basics (ASP.NET)[^]. You need to understand that you can't publish your asp.net pages via simple copy-paste operation, because of several reasons...

For further information, please refer these:
Creating ASP.NET Web Sites[^]
Creating ASP.NET Web Applications[^]
Deployment of a Website on IIS[^]
How to deploy ASP.NET Web Application on server[^]
 
Share this answer
 
Comments
[no name] 15-May-14 16:22pm    
Nevertheless my 5 for your help.
Regards, Bruno
Maciej Los 16-May-14 1:38am    
Thank you, Bruno ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900