摘要: 工作中遇到需要根据条件来选择插入or更新数据表某列,遇到了问题 万般调试和询问之后得到了解答View Code 1 //根据日期来选择列名2 using System.DateTime;3 4 DateTime dt=new DateTime();5 dt=DateTime.Now;6 int Date=dt.Day;7 cmd.CommandText="UPDATE overtimeinfo SET ["+Date+"] = '"+overtime+"' WHERE (name = '"+stufname+& 阅读全文
posted @ 2012-07-18 10:48 Ro_s__ 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 鉴于公司extaspnet版本没有checkboxlist控件 为了完成某些特定功能 需要我用checkbox完成checkboxlist的部分功能一下部分代码View Code 1 private string overtimetype(string ott) 2 { 3 int b=0; 4 if (CheckBox1.Checked) b = 1; 5 else if (CheckBox2.Checked) b = 2; 6 else if (CheckBox3.Checked) b = 3; 7 ... 阅读全文
posted @ 2012-07-17 17:35 Ro_s__ 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 根据这两天的学习,学会了怎么样把数据绑定在DataGrid。 先介绍一种dataAdapter的方式:View Code 1 private void BindGrid() 2 { 3 SqlConnection cnn = new SqlConnection(); 4 cnn.ConnectionString = "DataBase=stufinfomation;uid=sa;password=111111;"; 5 cnn.Open(); 6 SqlCommand cmd = new SqlComman... 阅读全文
posted @ 2012-07-16 14:21 Ro_s__ 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Web Service 的代码如下View Code using System;using System.Web;using System.Collections;using System.Web.Services;using System.Web.Services.Protocols;/// <summary>/// WebService 的摘要说明/// </summary>[WebService(Namespace = "http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfi 阅读全文
posted @ 2012-07-10 09:38 Ro_s__ 阅读(465) 评论(0) 推荐(0) 编辑
摘要: 首先先要配置asp.net网站的Web.Config在<configuration>标签下添加如下两行:1 <configSections>2 <section name="ExtAspNet" type="ExtAspNet.ConfigSection,ExtAspNet"/>3 </configSections>4 <ExtAspNet Language="zh_CN" EnableAjax="true" Theme="blue"/> 阅读全文
posted @ 2012-07-10 09:23 Ro_s__ 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1.进入控制面板的管理工具2.打开Internet信息服务(IIS)3.本地计算机-网站-默认网站-ASP.NET 属性4.在ASP.NET下ASP.NET版本 选择其他版本 并重启IIS 阅读全文
posted @ 2012-07-06 09:20 Ro_s__ 阅读(389) 评论(0) 推荐(0) 编辑
摘要: //建立sql连接类SqlConnection cnn = new SqlConnection();//建立command类SqlCommand cmd = new SqlCommand();//sql连接字符串,datasource是服务器所在地址,uid是sql模式登录用户名,password是登录密码 iniitial catalog是服务器名;cnn.ConnectionString = "Data Source=192.168.1.32;uid=sa;password=123456;initial catalog=test1";//打开数据库连接cnn.Open( 阅读全文
posted @ 2012-07-05 12:02 Ro_s__ 阅读(166) 评论(0) 推荐(0) 编辑