随笔分类 -  asp.net学习

参考书记录
摘要:黄皮书《ASP.NET 3.5从入门到精通》白皮书《ASP.NET 3.5》sql计算方法 黄皮书 458页产品记录方法 黄皮书 516页gridview 主从页 黄皮书 551页gridview 选一行 黄皮书 549页简单留言 黄皮书 593页CreateUserWizard 控件 黄皮书 692页fileupload控件 黄皮书 598页帐户与状态 黄 741页数据访问组件 商品和价格 黄皮... 阅读全文

posted @ 2010-08-09 11:38 midisong 阅读(87) 评论(0) 推荐(0)

try catch
摘要:try { con.Open(); added = cmd.ExecuteNonQuery(); Label1.Text = "<b>操作提示:</b><br />"; Label1.Text += added.ToString() + "条记录被添加成功。"; Label1.Text += con.ServerVersion; } catch (Excepti... 阅读全文

posted @ 2010-08-09 11:34 midisong 阅读(148) 评论(0) 推荐(0)

SQL语句
摘要:INSERT INTO Customer_Data //插入表(customer_id,first_name,last_name,phone) //字段VALUES (001,"Frank","liu",34312222) //值UPDATE Customer_DataSET first_name="Frank"WHERE last_name="liu" and customer_id = 001... 阅读全文

posted @ 2010-08-09 11:33 midisong 阅读(94) 评论(0) 推荐(0)

SQL复制表
摘要:SQL复制数据表 (select * into 与 insert into)select * into 目标表名 from 源表名insert into 目标表名(fld1, fld2) select fld1, 5 from 源表名以上两句都是将 源表 的数据插入到 目标表,但两句又有区别的:第一句(select into from)要求目标表不存在,因为在插入时会自动创建。 第二句(inser... 阅读全文

posted @ 2010-08-09 11:32 midisong 阅读(336) 评论(0) 推荐(0)

SQL命令修改数据
摘要:<asp:sqlDataSource ID="EmployeeDetailsSqlDataSource" SelectCommand="SELECT EmployeeID, LastName, FirstName FROM Employees WHERE EmployeeID = @EmpID" InsertCommand="INSERT INTO Employees(LastName, ... 阅读全文

posted @ 2010-08-09 11:32 midisong 阅读(231) 评论(0) 推荐(0)

session 用户名
摘要:string strID = Session["userid"].ToString(); string username ="select username from users where id='"+strID+"'"; SqlConnection con1=new SqlConnection(ConfigurationManager.AppSettings["SqlCon"]); con1.... 阅读全文

posted @ 2010-08-09 11:31 midisong 阅读(131) 评论(0) 推荐(0)

profile设置
摘要://web.config<anonymousIdentification enabled="true"/><profile automaticSaveEnabled="true"><properties><add name="UserAge" defaultValue="0" allowAnonymous="false" type="int"/>&l... 阅读全文

posted @ 2010-08-09 11:30 midisong 阅读(206) 评论(0) 推荐(0)

Profile扩展
摘要:web.config<system.web> <!-- 支持匿名访问,这是在需要授权时,对没有经过身份验证的实体进行标识所必需的 --> <anonymousIdentification enabled="true"/> <!-- 设置“成员/角色管理”权限规则 --> <profile defaultProvider=... 阅读全文

posted @ 2010-08-09 11:29 midisong 阅读(170) 评论(0) 推荐(0)

ObjectDataSource 控件代码
摘要:<asp:ObjectDataSource ID="EmployeeDetailsObjectDataSource" runat="server" TypeName="Samples.AspNet.Controls.NorthwindEmployee" SelectMethod="GetEmployee" UpdateMethod="UpdateEmployee" DeleteMe... 阅读全文

posted @ 2010-08-09 11:26 midisong 阅读(109) 评论(0) 推荐(0)

LinqDataSource控件代码
摘要:<asp:LinqDataSource ContextTypeName="ExampleDataContext" TableName="Products" EnableUpdate="true" EnableInsert="true" EnableDelete="true" ID="LinqDataSource1" runat="server"></asp:LinqDat... 阅读全文

posted @ 2010-08-09 11:24 midisong 阅读(241) 评论(2) 推荐(0)

gridview选择一行取出数据
摘要:using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.We... 阅读全文

posted @ 2010-08-09 11:23 midisong 阅读(757) 评论(0) 推荐(0)

formview模式设置
摘要:FormView1.DefaultMode = FormViewMode.Insert; 阅读全文

posted @ 2010-08-09 11:22 midisong 阅读(162) 评论(0) 推荐(0)

asp.net的email配置
摘要://webconfigsystem.net><mailSettings><smtp from="yourname@qq.com" deliveryMethod="Network"><network host="smtp.qq.com" port="25" defaultCredentials="false" password="my××... 阅读全文

posted @ 2010-08-09 11:21 midisong 阅读(201) 评论(0) 推荐(0)

DotNetTextBox用法
摘要:把这个添加到页面的第二行<%@ Register assembly="DotNetTextBox" namespace="DotNetTextBox" tagprefix="DNTB" %>把这个添加到引用的地方<DNTB:WebEditor ID="WebEditor1" runat="server" />web.config配置<appSettings>&l... 阅读全文

posted @ 2010-08-09 11:17 midisong 阅读(221) 评论(0) 推荐(0)

dataset导入数据库
摘要:protected void Button2_Click(object sender, EventArgs e) { DataSet ds = (DataSet)Session["test"]; SqlConnection conm = Conn.getConnetion(); if (conm.State.ToString() == "Closed") { conm.Open(); } Sq... 阅读全文

posted @ 2010-08-09 11:16 midisong 阅读(144) 评论(0) 推荐(0)

CSS字体无效问题
摘要:w3c标准存在冲突,用屏蔽代码页面最上方的一行可以解决。另外,某些浏览器用此方法会导致数据组件如:gridview字体变大,无法识别x-small字体大小。//组件只能识别页面默认字体。顶部的标准声明里改为:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xht... 阅读全文

posted @ 2010-08-09 11:15 midisong 阅读(493) 评论(0) 推荐(0)

asp.net数据库移植问题
只有注册用户登录后才能阅读该文。

posted @ 2010-08-09 11:13 midisong 阅读(1) 评论(0) 推荐(0)

初始化数据库
摘要:1.通过aspnet_regsql.exe初始化远程数据库;2.在vs里链接到远程数据库;aspnet_regsql.exe程序路径C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe 阅读全文

posted @ 2010-08-09 11:10 midisong 阅读(159) 评论(0) 推荐(0)

ASP.NET连接数据库字符串,web config用
摘要:<connectionStrings> <add name="sqlserver" connectionString="Data Source=.;Initial Catalog=myweb;Integrated Security=True" providerName="System.Data.SqlClient" /> <add name="websiteConne... 阅读全文

posted @ 2010-08-09 11:08 midisong 阅读(184) 评论(0) 推荐(0)

asp.net写入文件路径
摘要:原文,含格式!http://www.webasp.net/article/26/25649_print.htm把下面的代码保存为Upload.aspx即可运行(事先在同目录下建立一个Upload文件夹保存上传的文件,再建立一个数据库、表Upload,字段ID:自动编号,FilePath:文本型):<%@Import Namespace =Namespace="System.Data"%>... 阅读全文

posted @ 2010-08-09 11:06 midisong 阅读(274) 评论(0) 推荐(0)