国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開(kāi)發(fā) > 綜合 > 正文

beta2中的SqlConnection和SqlCommand

2024-07-21 02:23:45
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
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編過(guò)程序,你的代碼會(huì)看起來(lái)象下面的樣子
<%@ 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 -
現(xiàn)在新版本的beta2中看起來(lái)這樣
  
<%@ 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.

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 丰台区| 额济纳旗| 沾化县| 徐闻县| 青龙| 驻马店市| 沁源县| 松原市| 岳阳县| 腾冲县| 巴马| 科技| 马龙县| 太仆寺旗| 松江区| 北安市| 新竹市| 沙洋县| 喀喇沁旗| 祥云县| 平果县| 鲜城| 将乐县| 错那县| 铅山县| 明水县| 苏州市| 望奎县| 交城县| 磐安县| 武川县| 南丹县| 都昌县| 穆棱市| 玉门市| 禹州市| 甘孜县| 伊吾县| 景谷| 徐水县| 探索|