本帖最后由 feiniaoflyer 于 2012-11-29 05:46:30 编辑

解决方案 »

  1.   

    没出现lz说的问题。 测试版本为2008 R2create table [dbo].[T_Message]
        (
            [MaskId]         uniqueidentifier default newid() not null,
            [ProductMaskId]  uniqueidentifier,
            [Name]           nvarchar(50),
            [Email]          nvarchar(50),
            [Theme]          nvarchar(255),        
            [Content]        nvarchar(4000),
            [AddTime]        datetime default getdate()    
        )
        
        
        INSERT INTO t_message(ProductMaskId,name,email)
        SELECT NEWID(),'a','elele'
        
        
        SELECT * FROM T_Message
        
        
        /*
    MaskId                               ProductMaskId                        Name                                               Email                                              Theme                                                                                                                                                                                                                                                           Content                                                                                                                                                                                                                                                          AddTime
    ------------------------------------ ------------------------------------ -------------------------------------------------- -------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -----------------------
    EA37B1ED-6DCB-4A9B-AC4C-6E59F36885C2 34B5738F-EE36-461F-B1F3-9CE14FC9C561 a                                                  elele                                              NULL                                                                                                                                                                                                                                                            NULL                                                                                                                                                                                                                                                             2012-11-29 07:56:59.183(1 行受影响)
    */
      

  2.   

    原因是
    我传递的是SqlParameter[]参数,
    而DB.ExecuteCommand()里面没处理好,
    要加cmd.Parameters.Clear();
    留下记录以供后来者参考吧