Êý¾Ý½»»»Ñ§Ï°¶þ£ºasp.net C# ¶Ô sqlserver±íµÄ²Ù×÷
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
//ÏÔʾÊý¾ÝʾÀý
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//´´½¨±í¼°²åÈëÊý¾Ý
//use jwcrm
//create table userinfo(username char(10),userpwd char(10))
//insert into userInfo values('ÅËÍò·É','123456')
//insert into userInfo values('ÀîÊÀÃ÷','678910')
//select * from userinfo
//Á¬½ÓSQL
SqlConnection thisConnection = new SqlConnection("Server=127.0.0.1;uid=sa;pwd=123;database=jwcrm");
//´´½¨Êý¾Ý¿âÊÊÅäÆ÷
SqlDataAdapter thisAdapter = new SqlDataAdapter("select * from userinfo", thisConnection);
SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter);
DataSet thisDataSet = new DataSet();
thisAdapter.Fill(thisDataSet, "userinfo");
int i = 0;
foreach(DataRow rowData in thisDataSet.Tables[0].Rows)
{
i++;
&n
Ïà¹ØÎĵµ£º
ÔÚASPÖУ¬½«ÎļþÉÏ´«µ½·þÎñÆ÷ÊÇÒ»¼þ·Ç³£Âé·³µÄÊÂÇ飬ͨ³£ÐèÒªµÚÈý·½×é¼þµÄÖ§³Ö¡£
ÔÚASP.NET 1.x ÖУ¬ÒªÖ§³ÖÎļþÉÏ´«£¬Ö»ÐëʹÓÃHTMLµÄInput(File)¿Ø¼þ¡£°ÑËü×÷Ϊ·þÎñÆ÷¿Ø¼þÔËÐУ¨ÊÖ¶¯ÉèÖÃrunat="server"£© £¬ÒªÖ±½Ó²Ù×÷ HttpPostedFile¡£
ÔÚASP.NET 2.0ÖУ¬ÐÂÔöÁËFileUpLoad·þÎñÆ÷¿Ø¼þ£¬Ê¹µÃÉÏ´«¸ü¼Ó¼òµ¥¡£
°ü& ......
StringWriter sw = new StringWriter();
sw.WriteLine("·ÃÎʹºÂòÂÊ");
&nbs ......
1. ͼƬÎÊÌâ
·Ç³£ºÃ½â¾ö
<img runat="server" src="~/images/ad468x60.gif" alt="" />
¼ÓÉÏrunat="server" £¬Â·¾¶Ê¹Óþø¶Ô·¾¶~/»ù±¾ÉϾÍOKÁË¡£
2. CSSÎļþÒýÓÃ
<link rel="stylesheet" type="text/css" href="style.css" />
ÕâÀïÉñÆæµÄ¾ÍÊÇlinkµÄÎļþµÄhrefÊÇËæ×ű»·ÃÎÊÎļþµÄĿ¼½á¹¹×Ô¶¯µ÷Õû£¬Ëµ°×Á˾ ......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="Default" value="Default" />
</appSettings>
<connectionStrings>
<add name="Default" connectionString="Data Source=192.168.1.197;User ID ......