摘要: ASP.Net种使用C#, 向CoreDB.myBBS表中插入记录值(Title, Content)【文章的标题和内容】,由于Content, Title中可能包含单引号,直接使用sql的insert命令会报错,对此有两种处理方法,一种将单引号替换成两个单引号,第2种方法是使用存储过程。表myBBS的格式定义如下:CREATE TABLE [dbo].[myBBS] ([ID] [bigint] ... 阅读全文
posted @ 2009-12-30 16:15 唔愛吃蘋果 阅读(1773) 评论(0) 推荐(0)
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--stringaa="你好欢迎你来到博客园";byte[]byteArry=newbyte[0];byteArry=System.Text.Encoding.Default.GetBytes(aa);s... 阅读全文
posted @ 2009-12-30 15:32 唔愛吃蘋果 阅读(344) 评论(0) 推荐(0)
摘要: 在类的成员变量(全局变量)中,DateTime的默认值为:0001-1-1 0:00:00注:局部变量必须赋值才能使用 继承于System.ValueType的全是值(Struct)类型的: System.ArgIterator System.Boolean System.Byte System.Char System.Collections.DictionaryEntry System.Coll... 阅读全文
posted @ 2009-12-30 14:56 唔愛吃蘋果 阅读(14231) 评论(1) 推荐(0)
摘要: 如果想查找“_cs”结尾的的账户select * from [user] where loginname like '%_cs'是不行的,_ 被认为是任意的字符,所以需要转义字符,有两种写法:select * from [user] where loginname like '%[_]cs'select * from [user] where loginname like ... 阅读全文
posted @ 2009-12-30 00:16 唔愛吃蘋果 阅读(1074) 评论(0) 推荐(0)
摘要: SQL 的转义字符是:'(单引号)例:select * from tbl where uyear='''06'请注意其中红色背景的单引号,它即表示转义字符,如果我们省略,则整个语句会出错,转义字符不会输出,上例中 uyear 的实际条件值为 '06,而不是 ''06为什么不能省略呢,假如我们省略,上句变成:select * from tbl where uyear=''06'由于在 SQL 中单引... 阅读全文
posted @ 2009-12-30 00:10 唔愛吃蘋果 阅读(7376) 评论(0) 推荐(1)