• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

beta2中的SqlConnection和SqlCommand

发布: 2007-6-30 23:38 | 作者: admin | 来源: | 查看: 16次 | 进入软件测试论坛讨论

领测软件测试网 After a long struggle, I was able to install .NET Beta 2 but this is not the end of problems. As per as MSDN documentation, It is clearly mentioned that ASP.NET is supported on Win NT but dear Bill Gates fans just check out this letter from Scott and you will find that ASP.NET is not supported on NT for some technical reasons. And that@#s what I experienced with lot of efforts. Anyway, that@#s the past. Now, I@#m up with Win 2000 and on top of that I successfully installed 123 Mb of .NET and Mobile Internet Toolkit. As per as your expectations, I won@#t disappoint you. Although, In this particular article, I  won@#t discuss my mobile series. In this article, I@#ll discuss something new which I noticed when I start testing my first Beta 1 based application. There are many changes in Beta2 and first of them I noticed was ADO.NET area.

In this article, you@#ll see how to use SqlConnection and SqlCommand ADO.NET objects. First thing is, namespaces. There is no namespace called System.Data.SQL any more. IT has been changed with System.Data.SqlClient. See http://www.c-sharpcorner.com/Beta%202/adonet1.asp for more details.

If you had program in Beta 1, your code would look like this -
如果你用beta1编过程序,你的代码会看起来象下面的样子
<%@ Import Namespace="System.Data.SQL" %>
SQLDataReader myReader;
SQLConnection myConnection = new SQLConnection("server=localhost;uid=sa;pwd=sa;database=Shivani");
SQLCommand myCommand = new SQLCommand("Select * from ShivaniArea, myConnection);

try
{
myConnection.Open();
myCommand.Execute(out myReader);

while (myReader.Read())
{

// Retrieve the fields  
}
  



and now new version of Beta 2 looks like this -
现在新版本的Beta2中看起来这样
  
<%@ Import Namespace="System.Data.SqlClient"%>
SqlDataReader myReader;

SqlConnection myConnection = new SqlConnection("server=localhost;uid=sa;pwd=sa;database=Shivani");
SqlCommand myCommand = new SqlCommand("Select * from ShivaniArea", myConnection);
try
{
      myConnection.Open();
      myReader = myCommand.ExecuteReader;

while(myReader.Read())
{
    //Retrieve the fields
}
}  

During the testing of my mobile applications, I noticed more problems working with Beta 1 code. I was having problem working with the TagPrefix. Any way .. I@#ll be coming with more articles on this matter soon and keep updating you on Beta 2. In my next article, I will discuss how to deal with the problem of losing the DocumentNavigator Class in XML and take the real use of XMLDocument Class.

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网