ASP.NET 3.5中带有SQL连接字符串的类文件 [英] Class files with sql connection string in asp.net 3.5

查看:65
本文介绍了ASP.NET 3.5中带有SQL连接字符串的类文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#,asp.net 3.5和sql server2008.
如何在单独的类文件中定义sql连接字符串并在asp Web表单中使用它?
任何人都可以在asp.net 3.5中提供完整的教程类文件来帮助我.

请帮我..

谢谢与问候

Zukiari

I am using C#,asp.net 3.5, and sql server 2008.
How can i define sql connection string in a seperate class file and use it in my asp web form?
Can anybody help me with the complete tutorial class files in asp.net 3.5.

plz help me..

Thanks & regards

Zukiari

推荐答案

亲爱的朋友,

请点击链接以解决您的问题:-

http://www.dotnetfunda.com/articles/article71.aspx [ ASP.NET的三层代码生成器 [ ^ ]

http://nice-tutorials.blogspot.in/2010/10/3-tier-architecture-in-aspnet-using-c.html [
Dear Friend,

Please follow the links for your problem:-

http://www.dotnetfunda.com/articles/article71.aspx[^]

Three Tier Code Generator For ASP.NET[^]

http://nice-tutorials.blogspot.in/2010/10/3-tier-architecture-in-aspnet-using-c.html[^]

Don''t forget to mark this as your answer if it helps you out.

Thanks


你好朋友,

您只需将连接字符串存储在该类的一个属性变量中,然后通过创建该类的对象即可使用它.

您也可以添加app.config文件以单独存储连接字符串.

希望有帮助.
如果有任何查询,请发表评论.
Hello Friend,

you need to simply store the connection string in one of the property variable in that class and by creating the object of that class you can use it.

Also you can add app.config file to separately store the connectionstring.

Hope this help.
If any query do comment.


这篇关于ASP.NET 3.5中带有SQL连接字符串的类文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆