Monday, April 30

First article of my Blogger

Asp code:Connection


Last week,I am busy studing c# program language and asp language,Becauser I want to make web with c#.I am so tire that no time to write article in my blogger.
NOw, Write the asp connection database code:

OLEDB Connection:


provider=sqloledb;DataSource=server;InitialCatalog=basename;uid=username;pwd=pwd;

ODBC Connection:


driver={SQL SERVER};Server=server;DataBase=basename;Uid=username;Pwd=pass;

For Example:


OLEDB:


Sub OpenConnection()
Dim cn,rs,cnstr
Set cn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.Recordset")
cnstr="provider=sqloledb;DataSource=Local;InitialCatalog=test;Uid=sa;Pwd=123;"
cn.open cnstr
Rs.open "Select * from usrinfo ",2
End Sub

ODBC:


Sub OpenConnection()
Dim cn,cnstr
Set cn=Server.CreateObject("ADODB.Connection")
cnstr="driver={SQL SERVER};Server=Local;Database=test;Uid=sa;Pwd=1452;"
cn.open str
set Open_cn=cn
If Err Then
err.Clear
Cn.close:set Cn=nothing
Response.Write "Connect Database Error"
Response.end
End if
End Sub


最近一直忙着学习c#和asp,因为自己对这2门语言挺感兴趣,现在我已经可以用用asp做一个功能比较齐全的网站了,但还是不够熟练,是用dreamweaver辅助制作的,代码自己只能写一部分,另一部分靠软件生成.现在我最想做的事,就是学好c#,因为它的功能实在太强大了,我想用它来制作一个电子商务系统.可是现在对c#还是掌握不够.上周上课,老师说要找我5.1做项目(可是到现在也没消息:(,还好我没当回事),没消息我到挺松了一口气,要是真的去,我这技术怎么做啊.想想,我的知识太贫乏了.

1 comments:

Anonymous said...

hmm.. love this text..