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
Ïà¹ØÎĵµ£º
C# ASP.NETÀï@µÄÃîÓÃ
ASP.NET C# string ×Ö·û´®µÄÇ°Ãæ¿ÉÒÔ¼Ó @ ¿ÉÒÔ½«×ªÒå×Ö·û£¨\£©µ±×÷ÆÕͨ×Ö·û¶Ô´ý¡£
±ÈÈ磺string str = @"C:\Windows";
Èç¹ûÎÒÃDz»Óà @ µÄ»°£¬Ó¦¸ÃÊÇ£ºstring str = "C:\\Windows";
@ ×Ö·û´®ÖУ¬ÎÒÃÇÓÃÁ½¸öÁ¬ÐøÓ¢ÎÄË«ÒýºÅ±íʾһ¸öÓ¢ÎÄË«ÒýºÅ£¬ÈçÏÂ×Ö·û´®µÄʵ¼ÊÄÚÈÝΪ£º="=£¬×Ö·û´®³¤¶ÈΪ 3 ......
ÔÚASP.NETÏîÄ¿¿ª·¢ÖÐ,»á±»ÒªÇóÌí¼Ó¹ã¸æ,ÓзÆÁЧ¹û¡¢Óйã¸æÂÖÁ÷ÏÔʾ¡¢Æ®¸¡¹ã¸æ¡¢×ó²à¹ã¸æ¡¢ÓÒ²à¹ã¸æµÈ¡£Óñ¾Ìù³ÖÐø¼Ç¼һЩÊÕ¼¯µÄ¹ã¸æЧ¹û¡£Ï£Íû¸øÓÐÐèÇóµÄÅóÓÑÃÇһЩ֧³Ö¡£Ò²Ï£ÍûÅóÓÑÃÇ°ÑÎÒδ¼Ç¼µÄ¹ã¸æÐÎʽҲ¸øÓèÒ»Æð»ØÌù¡£Ê¹±¾Ìù¸ü¼ÓµÄÍêÉÆ£¬Ò²Èøü¶àµÄÅóÓÑÃÇ·ÖÏí¡£
1.·ÆÁЧ¹û
·ÆÁЧ¹û
<html>
<head>& ......
ÕâÀïÊÇ´ÓDatasetÀïµÄÊý¾ÝÉú³ÉÇúÏßͼ.
ÎÒµÄDatasetÊÇ´Ó±íSendrecÀï¶ÁÈ¡µÄÊý¾Ý,·Ö±ðÓÐId,Sendid(¶©µ¥ºÅ),Sendtime(¼Ç¼ʱ¼ä),Sendnum(µ¥Î»Ê±¼ä·¢ËÍÁ¿/ÎÒÕâÀïÊÇÎå·ÖÖÓ)¼¸¸ö×Ö¶Î
¹ý³ÌÈçÏÂ:
public void draw(Page page,DataSet ds,int Tnum){}
ÆäÖÐpageÊÇÓÃÀ´´«µÝÒýÓÃÕâ¸ö¹ý³ÌµÄÒ³Ãæ,ÕâÑùÈÃÒ³ÃæÊÇJPG·½Ê½Ö±½ÓÏò¿Í»§¶ËÊä³öÉú ......
ÉÏ´Î×öÁ˸öÏîÄ¿£¬Éæ¼°µ½Êý¾Ý¿âµÄ»¹ÔºÍ»Ö¸´£¬µ½ÍøÉÏÕÒÁËһϣ¬ÊÇÀûÓÃSQLDMOʵÏֵģ¬Ö»ÒªÌí¼ÓSQLDMOÒýÓþͺÃÁË£¬È»ºóÀûÓÃϱߵÄÀàµÄ·½·¨¾Í¿ÉÒÔʵÏÖÁË¡£
ÎÒ°ÑÔ×÷ÕßµÄÀàÀ©³äÁËһϣ¬¿ÉÒÔ×Ô¶¯Ê¶±ðweb.configÀï µÄÊý¾Ý¿âÁ¬½Ó×Ö·û´®£¬¿ÉÒÔͨ¹ý±äÁ¿ÉèÖû¹Ô»Ö¸´µÄÐÅÏ¢¡£
ÐèҪעÒâµÄʱ»¹Ô£¬»¹ÔµÄʱºòÎÊÌ ......