SqlConnection and SqlCommand in the Beta2

Source: Internet
Author: User
Command|connection after a long struggle, I am able to install. NET Beta 2 But the "not" end of problems. As as as MSDN documentation, IT is clearly mentioned this asp.net is supported on Win NT but dear Bill Gates fans just CH Eck out of this letter from Scott and would find that ASP.net isn't 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" and "Top" I successfully installed 123 Mb. NET and Mobile Internet Toolkit. As per as your expectations, I won ' t disappoint for 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 a Beta 1 based application. There are many changes in Beta2 and a them I noticed am ado.net area.

In this article, you'll have to SqlConnection and SqlCommand ado.net objects. The thing is, namespaces. There is no namespace called System.Data.SQL any more. IT has been changed with System.Data.SqlClient. Http://www.c-sharpcorner.com/Beta%202/adonet1.asp for more details.

If you are had in Beta 1, your code would look like this-
If you've programmed with Beta1, your code will look like the following
<%@ 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 the Beta 2 looks like this-
Now it looks like this in the new version of 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 problems working with Beta 1 code. I was had problem working with the TagPrefix. Any way. I ' ll be the coming with the more articles in this matter soon and keep updating for you on Beta 2. In my next article, I'll discuss how to deal with the problem of losing the Documentnavigator Class in XML and take the Real use of XmlDocument Class.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.