ASP.NET连SQL7接口的源代码
The following example shows what a simple application that connects to the Northwind database and returns a list of Categories would look like. The example writes the output to the console, or command prompt.
The following example shows what a simple application that connects to the Northwind database and returns a list of Categories. The example writes the output to the console, or command prompt.
SqlClient
[Visual Basic]
Imports System
Imports
Imports lient
Imports alBasic
Public Class Sample
Public Shared Sub Main()
Dim nwindConn As SqlConnection = New SqlConnection("Data Source=localhost;" & _
"User Id=sa;Password=pwd;Initial Catalog=northwind")
Dim catCMD As SqlCommand = teCommand()
mandText = "SELECT CategoryID, CategoryName FROM Categories"
()
Dim myReader As SqlDataReader = uteReader()
Do While ()
eLine(vbTab & "{0}" & vbTab & "{1}", nt32(0), tring(1))
Loop
e()
e()
End Sub
End Class
[C#]
using System;
using ;
using lient;
class Sample
{
public static void Main()
{
SqlConnection nwindConn = new SqlConnection("Data Source=localhost;User Id=sa;Password=pwd;Initial Catalog=northwind");
SqlCommand catCMD = teCommand();
mandText = "SELECT CategoryID, CategoryName FROM Categories";
();
SqlDataReader myReader = uteReader();
while (())
{
eLine("t{0}t{1}", nt32(0), tring(1));
}
e();
e();
}
}
OleDb
[Visual Basic]
Imports System
Imports
Imports b
Imports alBasic
Public Class Sample
Public Shared Sub Main()
Dim nwindConn As OleDbConnection = New OleDbConnection("Provider=SQLOLEDB;Data Source=localhost;" & _
"User Id=sa;Password=pwd;Initial Catalog=northwind")
Dim catCMD As OleDbCommand = teCommand()
mandText = "SELECT CategoryID, CategoryName FROM Categories"
()
Dim myReader As OleDbDataReader = uteReader()
Do While ()
eLine(vbTab & "{0}" & vbTab & "{1}", nt32(0), tring(1))
Loop
e()
e()
End Sub
End Class
[C#]
using System;
using ;
using b;
class Sample
{
public static void Main()
{
OleDbConnection nwindConn = new OleDbConnection("Provider=SQLOLEDB;Data Source=localhost;User Id=sa;Password=pwd;Initial Catalog=northwind");
OleDbCommand catCMD = teCommand();
mandText = "SELECT CategoryID, CategoryName FROM Categories";
();
OleDbDataReader myReader = uteReader();
while (())
{
eLine("t{0}t{1}", nt32(0), tring(1));
}
e();
e();
}
}
-
php项目经理的职责表述7篇
php项目经理的职责表述11、负责售前技术支持。配合销售人员作售前产品技术讲解、演示;2、根据客户需求反馈研发,提供良好解决方案3、远程现场技术支持4、网络环境搭建和服务器配置;5、车载产品安装调试;6、软件平台安装调试;7、负责区域售后技术支持;8、参与项...
-
JavaScript的课堂讲解
本文主要内容:1.分析函数的四种调用形式2.弄清楚函数中this的意义3.明确构造函对象的过程4.学会使用上下文调用函数一、函数调用形式函数调用形式是最常见的形式,也是最好理解的形式。所谓函数形式就是一般声明函数后直接调用即是。例如:复制代码代码如下://声明...
-
如何理解Javascript的caller,callee,call,apply区别
在提到上述的概念之前,首先想说说javascript中函数的隐含参数:argumentsarguments该对象代表正在执行的函数和调用它的函数的参数。[function.]arguments[n]参数function:选项。当前正在执行的Function对象的名字。n:选项。要传递给Function对象的从0开始的参数值...
-
如何理解Javascript的caller,callee,call,apply区别
在提到上述的概念之前,首先想说说javascript中函数的隐含参数:argumentsarguments该对象代表正在执行的函数和调用它的函数的参数。[function.]arguments[n]参数function:选项。当前正在执行的Function对象的名字。n:选项。要传递给Function对象的从0开始的参数值...
相关文章
- 人教PEP版小学五年级英语下册Unit3Myschoolcalender.ALet’stalk
- asp.net动态获取Excel表名的代码
- Is a Test of Spoken English Necessary英语四级作文
- Unit3Onlinetravel(SpeakupandStudyskills)学案
- 用PHP连接MySQL代码的参数说明
- 关于ASP.NET使用JavaScript显示信息提示窗口实现原理及代码
- php连接mysql数据库代码
- 关于MyEclipse代码提示设置包括html和jsp的代码
- java的String=a; a==null和a.equals(null)这两个判断有什么区别
- MS SQL Server Management Studio Express安装图文具体步骤