05 2011 档案
摘要:其实很简单,只是在窗体加载的时间需要两句代码就ok了小数点设为两位,增幅为0.25即numericUpDown1.DecimalPlaces = 2;numericUpDown1.Increment = 0.25M;
阅读全文
摘要:View Code 1 public partial class City : System.Web.UI.Page 2 { 3 protected void Page_Load(object sender, EventArgs e) 4 { 5 if(!IsPostBack) 6 { 7 BindProv(); 8 BindCity(); 9 }10 }11 12 //绑定市13 private void BindCity()14 {15 ddlcity.Items.Clear();16 DataTable citydt = new CitySer().GetAllCityByProvId(
阅读全文
摘要:1.添加DLL引用,文件名为:AspNetPager.dll。2.在aspx文件中添加<%@ RegisterAssembly="AspNetPager" Namespace="Wuqi.Webdiyer"TagPrefix="webdiyer" %>代码,下面是分页样式代码:3.在CS文件中写using Wuqi.Webdiyer;4.获取数据源,下面是获得数据的一个方法,BLL.Trunk.GetAllList方法是一个封装过的方法,返回一个DataSet结果集,这个方法自己写就可以,这是来自项目中的代码:View C
阅读全文
摘要:View Code 1 /// <summary> 2 /// 历史记录 3 /// </summary> 4 private static int sumcount; 5 private void BindHistory() 6 { 7 this.gdvHistory.DataSource = null; 8 this.gdvHistory.DataBind(); 9 DataTable table = null;10 DateTime dtst = Convert.ToDateTime(DateTime.Now.ToShortDateString() + &quo
阅读全文
摘要:首先页面布置好控件代码是这样的View Code 1 Code 2 Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 3 <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %> 4 <
阅读全文
摘要:1.View Code 1 using System.Text; 2 using System.IO; 3 4 XmlNode xmlNode1; 5 XmlDataDocument xd=new XmlDataDocument(); 6 StringBuilder xmlString1; 7 8 xmlNode1=DataSet1;//DataSet1为返回的数据集 9 if(xmlNode1==null) //--存储过程执行失败10 return;11 xmlString1=new StringBuilder(xmlNode1.OuterXml);12 if(xmlString1.ToS
阅读全文
摘要:第一种是写在代码里的View Code 1 Response.Redirect("adminUpdate.aspx?userName=" + gvAdminInFo.SelectedRow.Cells[1].Text.ToString().Trim() + "&userJiaoSe=" + gvAdminInFo.SelectedRow.Cells[2].Text.ToString().Trim() +2 "&userStart=" + gvAdminInFo.SelectedRow.Cells[3].ToString
阅读全文
摘要:C#中改变dgv中的字体很简单的,只需要一个简单的方法,就OK了View Code 1 //改变字体 2 private void btnFont_Click(object sender, EventArgs e) 3 { 4 try 5 { 6 FontDialog fontDialog = new FontDialog(); 7 fontDialog.Color = dgvHistroy.RowTemplate.DefaultCellStyle.ForeColor; 8 fontDialog.Font = dgvHistroy.RowTemplate.DefaultCellStyle.Fo
阅读全文
摘要:View Code 1 privatestaticint nciisMoidyOffFinance(IP_OrderDrivingLicence model_orders, int typeId)2 {3 //查询消费时,保存记录编号4 int OrderId =0;5 using (SqlConnection connection =new SqlConnection(SqlHelper.connectionString))6 {7 connection.Open();8 //使用当前的SQL连接 创建事务并添加共享锁9 SqlTransaction tran = connection.Be
阅读全文
摘要:View Code 1 /// <summary> 2 /// 过滤html标签 3 /// </summary> 4 /// <param name="strHtml">html的内容</param> 5 /// <returns></returns> 6 public static string StripHTML(string stringToStrip) 7 { 8 // paring using RegEx // 9 stringToStrip = Regex.Replace(stringTo
阅读全文
摘要:asp.net如何读取xml文件中的数据2008-01-20 16:42news.xml文件:View Code 1 <?xml version="1.0" encoding="gb2312"?><xinwen><news> <news_id>5</news_id> <news_title>XML新闻发布系统</news_title> <news_author>***</news_author> <news_ly>原创</news
阅读全文
摘要:/// <summary> /// 一些常用的Js调用 /// <summary>View Code 1 public class Jscript 2 { 3 /// 弹出JavaScript小窗口 4 /// </summary> 5 /// <param name="js">窗口信息</param> 6 public static void Alert(string message) 7 { 8 #region 9 string js = @"<Script language='Java
阅读全文
摘要:在c#中如何将dataGridView中的数据导出,可以写出以下代码直接调用View Code 1 /// <summary> 2 /// 将 DataGridView的数据导出Excel 3 /// </summary> 4 /// <remarks> 5 /// using System.IO; 6 /// </remarks> 7 /// <param name="dgv"></param> 8 public static void DataGridViewToExcel(bxyztSkin.E
阅读全文
摘要:C#中列出重复项是很简单的,呵呵,只需要将下面一段代码放到按钮下面即可:列出重复项 1 private void btndouble_Click(object sender, EventArgs e) 2 { 3 if (dt_tmp == null) 4 { 5 return; 6 } 7 DataTable dt_New = dt_tmp.Clone(); 8 int count = 0; 9 foreach (DataRow item in dt_tmp.Rows)10 {11 foreach (DataRow row in dt_tmp.Rows)12 {13 if (item[&qu
阅读全文
摘要:ASP.Net实现图片上传:实现图片上传的方法 1 try 2 { 3 //((Image)gvGradeUser.FindControl(ImageGrade)).ImageUrl.ToString().Trim(); 4 //根据等级的编修改 5 int enbale = 0; 6 if (ddlStart.Text.ToString().Trim() == "正常") 7 { 8 enbale = 0; 9 }10 else11 {12 enbale = 1;13 }14 //图片存在时15 if (FtxtFlileName.HasFile)16 {17 Ftxt
阅读全文
摘要:生成验证码的方法using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Drawing;using System.Drawing.Imaging;using System.IO;using System.Web.UI.HtmlControls;using System.Web.UI.WebContro
阅读全文
摘要:SQL中有各种功能的函数,下面就将为您介绍SQL中left()函数和charindex()函数的使用的使用方法,希望对您学习SQL函数的使用能够有所帮助。 View Code 1 1、left() 2 LEFT (<character_expression>, <integer_expression>) 3 返回character_expression 左起 integer_expression 个字符。 4 5 2.charindex() 6 返回字符串中某个指定的子串出现的开始位置。 7 CHARINDEX (<’substring_expression’&g
阅读全文
摘要:得到radiobuttonlist选中值:View Code 1 var CheckBoxList=document.all.optButtonList; 2 var objCheckBox,CheckValue=""; 3 for(i=0;i<CheckBoxList.rows.length;i++) 4 { 5 objCheckBox = document.getElementById('optButtonList'+ "_" + i); 6 if(objCheckBox.checked == true) 7 { 8 Check
阅读全文

浙公网安备 33010602011771号