07 2013 档案

摘要:alter table Score add constraint PK_stuid_cousreId primary key(stuid,cousreId)go 阅读全文
posted @ 2013-07-29 08:07 秋日的私语(且行且珍惜) 阅读(157) 评论(0) 推荐(0)
摘要:if exists(select * from sys.sysdatabases where [name] = 'DB_Student')drop database DB_Studentgocreate database DB_Studenton( name = DB_Student_mdf, filename = 'E:\DB_Student_mdf.mdf', size = 3mb, maxsize = 100mb, filegrowth=1mb)log on( name = DB_Student_ldf, filename = 'E:\DB_Stu 阅读全文
posted @ 2013-07-23 02:14 秋日的私语(且行且珍惜) 阅读(206) 评论(0) 推荐(0)
摘要:select top 1 with ties name,stuId,sex,score from stuInfo order by score desc 阅读全文
posted @ 2013-07-23 01:23 秋日的私语(且行且珍惜) 阅读(195) 评论(0) 推荐(0)
摘要:select distinct sex from stuInfo//查询不重复的select top 3 * from stuInfo//查询表的前三行select top 30 percent * from stuInfo//查询表的前边的百分之三十行select top 2 * from stuInfo order by NEWID() 阅读全文
posted @ 2013-07-23 01:16 秋日的私语(且行且珍惜) 阅读(118) 评论(0) 推荐(0)
摘要:1、delete from table_Usergo2、truncate table table_Usergo这两种方法删除的结果一样,都是删除表中所有的数据,但是第二种方法删除得更快,使用的系统资源和事务日志资源更少。Delete :删除数据表中的行(可以删除某一行,也可以在不删除数据表的情况下删除所有行)。删除某一行:Delete from 数据表名称 where 列名称=值;删除所有行:Delete * from 数据表名称Drop :删除数据表或数据库,或删除数据表字段。删除数据库:drop database 数据库名称删除数据表:(表的结构、属性、索引也会被删除) use 数据库名称 阅读全文
posted @ 2013-07-23 00:49 秋日的私语(且行且珍惜) 阅读(4447) 评论(0) 推荐(1)
摘要:1、insert into stuInfo(name,stuId) values('李洁','19291727')insert into stuInfo(name,stuId) values('李康','19291728')insert into stuInfo(name,stuId) values('何洁','19291729')insert into stuInfo(name,stuId) values('何宇','19291730')go2、insert int 阅读全文
posted @ 2013-07-23 00:40 秋日的私语(且行且珍惜) 阅读(371) 评论(0) 推荐(0)
摘要:全选一行的的属性是:SelectionMode = FullROwSelect; 阅读全文
posted @ 2013-07-22 12:08 秋日的私语(且行且珍惜) 阅读(122) 评论(0) 推荐(0)
摘要:UserInsert ui = new UserInsert(); ui.ShowDialog();//ui.DialogResult if (ui.DialogResult == DialogResult.OK) { SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=Test;Integrated Security=True"); conn.Open(); SqlDataAdapter da = new SqlDataAdapter("select id,name from 阅读全文
posted @ 2013-07-22 08:35 秋日的私语(且行且珍惜) 阅读(194) 评论(0) 推荐(0)
摘要:windows系统默认连接:Data Source=.;Initial Catalog=Test;Integrated Security=Truesqlserver验证连接:server=.;database=Test;uid=sa;pwd=123456 阅读全文
posted @ 2013-07-22 08:34 秋日的私语(且行且珍惜) 阅读(182) 评论(0) 推荐(0)
摘要:下边是实现的代码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Text.RegularExpressions;namespace Registerting{ public partial class Form1 : Form { public Form1() { I 阅读全文
posted @ 2013-07-16 11:31 秋日的私语(且行且珍惜) 阅读(156) 评论(0) 推荐(0)
摘要:string reg = @"^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"; 阅读全文
posted @ 2013-07-16 10:55 秋日的私语(且行且珍惜) 阅读(162) 评论(0) 推荐(0)
摘要:publicForm1(){InitializeComponent(); textBox1.Enter+=newEventHandler(textBox1_Enter);//获得焦点事件 textBox1.Leave+=newEventHandler(textBox1_Leave);//失去焦点事件。 }void textBox1_Enter(object sender,EventArgs e){MessageBox.Show("获得了焦点");}void textBox1_Leave(object sender,EventArgs e){MessageBox.Show(& 阅读全文
posted @ 2013-07-16 08:51 秋日的私语(且行且珍惜) 阅读(1543) 评论(0) 推荐(0)
摘要:for (int i = 0; i < chkLSelect.Items.Count; i++) { if (chkCheck.Checked == true) { chkLSelect.SetItemChecked(i, true); } else { chkLSelect.SetItemChecked(i,false); } } 阅读全文
posted @ 2013-07-15 18:22 秋日的私语(且行且珍惜) 阅读(570) 评论(0) 推荐(0)
摘要:DialogResult dr = MessageBox.Show("你确定要点击吗", "安全提示", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { this.Close(); } else { MessageBox.Show("我好想睡觉啊"); } Form2 form = new Form2(); form.Show(); this.Hide(); 阅读全文
posted @ 2013-07-15 15:35 秋日的私语(且行且珍惜) 阅读(161) 评论(0) 推荐(0)
摘要:引用类型:类,接口,委托装箱:值类型——引用类型拆箱:引用类型——值类型在C#语言中,用正则表达式,需要引用命名空间,using system.text.RegulerExpression对于正则表达式里的\t等字符,有两种方式处理,1:用转义字符,在前边加上\2:在前进加上@符号匹配时候用:Regex.IsMatch(a,b)//把输入的a和正则表达式b判断该表达式返回的是一个布尔值 阅读全文
posted @ 2013-07-14 14:38 秋日的私语(且行且珍惜) 阅读(134) 评论(0) 推荐(0)
摘要:1.隐式转换2.显示转换(弱类型转换)string i = "12";int k = int.Parse(i);(强制性转换)convert 阅读全文
posted @ 2013-07-14 14:16 秋日的私语(且行且珍惜) 阅读(153) 评论(0) 推荐(0)
摘要:start:string name; int age; Console.Write("请输入您的名字:"); name = Console.ReadLine(); Console.Write("请输入您的年龄:"); age = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("姓名是:{0},年龄是:{1}", name, age); Console.WriteLine("姓名是:"+name+",年龄是:"+ age); Cons 阅读全文
posted @ 2013-07-14 14:02 秋日的私语(且行且珍惜) 阅读(186) 评论(0) 推荐(0)