[英]Connecting to a database through a webservice
Could someone please help me to connect to a database through a webservice in c#. 有人可以帮我通过c#中的Web服务连接到数据库。
I currently have, 我目前有
Could someone please help me out. 有人可以帮我吗。
Thanks 谢谢
Since you mention you have a DBML file, I'm assuming your'e using Linq-to-SQL. 既然您提到您有一个DBML文件,所以我假设您使用的是Linq-to-SQL。 ScottGu has some great starter tutorials on using the technology.
ScottGu有一些使用该技术的出色入门教程。 Here is one of them:
这是其中之一:
http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx
Bottom line at the very basic level you're DBML has a bunch of code behind including the DataContext classes that you run your queries against, using something like: 最基本的说来,您是DBML,其背后有一堆代码,其中包括运行查询所依据的DataContext类,使用的方法如下:
DataClasses1DataContext dc = new DataClasses1Datacontext();
var q = from table in dc.SomeTable
select table;
Again the link above has some really good examples of how to use Linq-to-SQL. 同样,上面的链接提供了一些非常好的使用Linq-to-SQL的示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.