上一页 1 ··· 6 7 8 9 10 11 下一页
摘要: 先通过设计器手动添加,然后通过代码来添加 手动增加约束 --手动删除一列(删除EmpAddress列) alter table Employees drop column EmpAddress go --手动增加一列(增加一列EmpAddr varchar(1000)) alter table Em 阅读全文
posted @ 2012-07-26 14:50 51秒懂 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 存储字符串的几种数据类型 char(10) nchar(10) varchar(10) nvarchar(10) varchar(max) nvarchar(max) --不建议使用text与ntext,推荐使用varchar(max)与nvarchar(max) text ntext varcha 阅读全文
posted @ 2012-07-26 14:18 51秒懂 阅读(414) 评论(0) 推荐(0) 编辑
摘要: 真正自己做题时候,会遇到很多很2的情况 比如说 老是插入不进去,发现是数据库设的字符长度不够 有时候是sql语句的问题 创建数据库 --创建数据库的时候,指定一些数据库的相关参数,比如大小,增长方式i、文件保存路径的。 create database School on primary --主数据文 阅读全文
posted @ 2012-07-26 14:15 51秒懂 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 1、编写程序计算1+2+3+....+100的和。 int i; int sum = 0; for (i = 0; i < 101; i++) { sum += i; } Console.WriteLine("{0}",sum); Console.ReadKey();2、已知一个int数组, 编程从数组中获取最大数。 static int MaxValue(int[] intArray) { int maxVal = intArray[0]; for (int i = 0; i < intArray.Length - 1; i++) { if (intArray 阅读全文
posted @ 2012-03-19 17:21 51秒懂 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 写了个页面 由于每次调用都需要连接远程的服务器,特别浪费资源,创建了aspx<%@ Control Language="C#" AutoEventWireup="true" CodeFile="HotProduct.ascx.cs" Inherits="resource_ascx_HotProduct" %><%@ OutputCache Duration="36000" VaryByParam="none" %><div class=" 阅读全文
posted @ 2012-03-08 14:05 51秒懂 阅读(191) 评论(0) 推荐(0) 编辑
摘要: select m_id from a_cms_Content where M_CategoryID in (select M_CategoryID from a_cms_Content where M_Id='61dbe004-5535-419a-9802-e57af7ca7dc9') 阅读全文
posted @ 2012-03-05 09:12 51秒懂 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 实现文章上一页 下一页的效果 通过调用数据库using(SqlConnection con=new SqlConnection(@"server=..")){Guid article_id=new Guid("文章的id号")Guid perArticleId=Guid.Empty;Guid NextArticleId=Guid.Empty;//获取文章栏目String strSql=string.Format("select M_categoryid from a_cms_content where m_id='{0}'&qu 阅读全文
posted @ 2012-03-01 17:02 51秒懂 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 第三十四讲 枚举如果你想让一组数字代表特定的意义,并且希望是安全的,可读性 强。那就用枚举吧enum Color{Red,Green,Blue}代码:namespace _234 { //enum Color {Red,Green,Blue } //enum Color:long { Red, Green, Blue } enum Color { Red, Green=10, Blue } public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(o 阅读全文
posted @ 2012-02-24 14:29 51秒懂 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 第二十九讲 抽象类抽象类:专门用于继承的类1.声明一个抽象类使用abstract关键字2.一个抽象类中可以包含几个抽象方法。也使用abstract3.抽象类中可以存在非抽象的方法4.抽象类不能被直接被实例化覆盖父类中的抽象方法 override代码部分private void Form1_Load(object sender, EventArgs e) { //抽象类不能实类化 //Person theStudent = new Person(); Person theStudent = new Student(); theStudent.SayHello(); theStudent.abo. 阅读全文
posted @ 2012-02-23 17:40 51秒懂 阅读(369) 评论(0) 推荐(0) 编辑
摘要: 第二十二讲 方法的重载编译器可以自动选择调用哪个方法重载“不是面向对象特征”,“不是多态特征”,而是一种“方便” 的特征代码{ Test theTest=new Test(); //编译器自动判断使用哪个函数 int intMax=theTest.max(4,5); double doubleMax=theTest.max (4.444,5.555); string stringMax=theTest.max("无天听 过吗?","无天是我"); //显示出来 MessageBox.Show(intMax.ToString()); MessageBox. 阅读全文
posted @ 2012-02-23 15:48 51秒懂 阅读(366) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 下一页