tbClass存放论坛分类

字段名

字段类型

允许空

说明

ClassID

uniqueidentifier

GUID主键,默认值newid()

ClassName

Varchar(50)

分类名

tbBoard存放论坛分类中的版块

字段名

字段类型

允许空

说明

BoardID

uniqueidentifier

GUID主键,默认值newid()

BoardName

Varchar(50)

版块名

BoardClassID

uniqueidentifier

版块所属分类的ID

存储过程spCreateBoard

CREATE PROCEDURE spCreateBoard

(

       @ClassName varchar(50),    //输入参数

       @BoardName varchar(50),   //输入参数

       @ClassID varchar(50) output  //输出参数

)

AS

declare @BoardCount int;

set @ClassID=(select ClassID from tbClass where ClassName = @ClassName);

insert into tbBoard(BoardName,BoardClassID) values (@BoardName,@ClassID);

set @BoardCount = (select count(*) from tbBoard);

return @BoardCount;

GO

界面TextBox1TextBox2
使用SqlCommand对象执行存储过程

按钮事件代码:

        }

结果:
使用SqlCommand对象执行存储过程

相关文章:

  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-11-18
  • 2021-09-26
  • 2021-12-11
  • 2021-10-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
相关资源
相似解决方案