Asp.net连接数据库教程(vb.net)
Asp.net连接SQL Server2000数据库例程详解:
<%@ Import Namespace="System.Data" %>
<%@ Import NameSpace="System.Data.SqlClient" %>
<script laguage="VB" runat="server">
sub page_load(sender as Object,e as EventArgs)
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim ds as DataSet
'1.connect to sql server
myConnection = New SqlConnection( "server=localhost;database=Pubs;uid=ueytjdf;pwd=doekdf" )
myConnection.Open()
la1.text="Connection Opened!"
'2.Create a table
myCommand = New SqlCommand( "CREATE TABLE [test] ([id] [int] IDENTITY (1, 1) NOT NULL ,[name] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,[sex] [char] (10) COLLATE Chinese_PRC_CI_AS NULL )", myConnection )
myCommand.ExecuteNonQuery()
la2.text="New table created!"
'2 添加纪录
myCommand = New SqlCommand( "Insert into [test] (name,sex) values( '黄志文','男' )", myConnection )
myCommand.ExecuteNonQuery()
la3.text="New Record Inserted!"
'3 更新数据
myCommand = New SqlCommand( "UPDATE [test] SET name='Smith' where name='李明'", myConnection )
myCommand.ExecuteNonQuery()
la4.text="Record Updated!"
'4 删除数据
myCommand = New SqlCommand( "delete from [test] where name='Smith'", myConnection )
myCommand.ExecuteNonQuery()
la5.text="Record Deleted!"
'5 用DataGrid显示数据
myComma
相关文档:
在早期的ASP.NET框架中,如果你放置一个控件在一个容器中,如GridView模板列、登录模板、其它,在运行时这些控件的ID将被替换由ASP.NET自身产生的随机唯一ID。
为开发者提供服务方访问控件的Page.FindControl("controlid")以及JavaScript中使用 的document ......
需求:
A域有页面a.html,其中有iframe包含B域的页面b.html,现在要通过a.html上的一个按钮,来把a.html页面上一个文本框的值传递到b.html页面的文本框。
注:这里b.html是html网页,不能接收其他网站post过来的值,所以不能用直接post的方法来传值,但是,如果接收页面是b.aspx或者b.asp 呢,那不是可以直接post了么?答 ......
/// <summary>
/// 写Cookies
/// </summary>
/// <param name="response"></param>
/// <param name="request"></param>
&n ......
web.config:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="chunyou128<you@163.com>">
&n ......