数据库连接问题.... [英] Database connectivity problem....
问题描述
嗨..
我在数据库连接方面遇到问题....
我我在ASP.NET c#.NET 3.5 SQL Server 2005和Visual Studio 2008中的一个项目中工作。
我在ASP.NET C#3.5框架中开发了一个Web应用程序在Visual Studio 2008和SQL Server 2005中的数据库中。我的计算机中有SQL Server Management Studio Express 2005.
我已完成项目和数据库。
现在当我复制包含-AppData文件夹...项目文件夹的项目文件夹时出现问题。到另一台电脑。
和SQL Server数据库我创建了备份为.bak文件。
现在当我来到新计算机,我粘贴了Project文件夹。我用Visual Studio 2008打开项目文件夹。程序运行正常。但是,当我双击任何按钮或文本框,而不是在代码页(.cs文件)中打开时,按钮单击事件将在脚本标记内的源页面中打开.--- 这是我的问题No.1 。
我恢复了sql server数据库的.bak文件。
我的项目在每个asp.net页面中都包含连接字符串。我在新计算机中更改服务器名称和数据库名称。
现在,当我运行项目时,我的错误是给出了一些与实例相关的错误。我试了很多但是无法解决它。
Sqldataadapter da = new sqldataadapted(insert into table name ....,con);
Dataset ds = new Dataset;
da.fill(ds)----在这一行显示错误.----这是我的问题2
先谢谢你的帮助。
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.
推荐答案
请阅读对这个问题的评论。您没有提供足够的信息来帮助您。不过......
我建议你回到基础知识(ASP.NET) [ ^ ]。您需要了解您无法通过简单的复制粘贴操作发布您的asp.net页面,原因有多种...
如需了解更多信息,请参阅以下内容:
创建ASP.NET网站 [ ^ ]
创建ASP.NET Web应用程序 [ ^ ]
在IIS上部署网站 [ ^ ]
如何在服务器上部署ASP.NET Web应用程序 [ ^ ]
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[^]
这篇关于数据库连接问题....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!