在项目事件中Initialize 中代码如下
Dim lst As List(Of String)
lst = Connections("nwnd").GetTableNames
If lst.Contains("MINE") =False Then '判断没有包含这个表
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "CREATE TABLE [dbo].[MINE] ([_Identify] [int] IDENTITY (1, 1) NOT NULL ,[_Locked] [bit] NULL ,[_SortKey] [numeric](28, 0) NULL ,[MINE] [nvarchar] (16) COLLATE Chinese_PRC_CI_AS NULL ) ON [PRIMARY]"
cmd.ExecuteNonQuery()
ElseIf lst.Contains("取气明细") =False Then
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "CREATE TABLE [dbo].[取气明细] ([_Identify] [int] IDENTITY (1, 1) NOT NULL ,[_Locked] [bit] NULL ,[_SortKey] [numeric](28, 0) NULL ,[类型] [nvarchar] (32) COLLATE Chinese_PRC_CI_AS NULL ,[日期] [datetime] NULL ,[客户] [nvarchar] (32)COLLATE Chinese_PRC_CI_AS NULL ,[数量] [float] NULL ,[单价] [float] NULL ,[单位] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,[金额] [float] NULL ,[编号] [nvarchar] (32) COLLATE Chinese_PRC_CI_AS NULL ) ON [PRIMARY]"
cmd.ExecuteNonQuery()
ElseIf lst.Contains("取气表") =False Then
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "CREATE TABLE [dbo].[取气表] ([_Identify] [int] IDENTITY (1, 1) NOT NULL ,[_Locked] [bit] NULL ,[_SortKey] [numeric](28, 0) NULL ,[类型] [nvarchar] (32) COLLATE Chinese_PRC_CI_AS NULL ,[日期] [datetime] NULL ,[客户] [nvarchar] (32) COLLATE Chinese_PRC_CI_AS NULL ,[数量] [float] NULL ,[单价] [float] NULL ,[单位] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,[金额] [float] NULL ,[编号] [nvarchar] (32) COLLATE Chinese_PRC_CI_AS NULL ) ON [PRIMARY]"
cmd.ExecuteNonQuery()
end if
为什么打开项目只创建一个表呀,不能同时创建所有表?