栏目导航
热点推荐
- 心得:Sql语句绝妙用法
- SQL Server数据转换服务小妙招
- SQL Server数据库常用的T-SQL命
- 详解SQLServer 存储过程
- SQL数据库挂马解决方案
- 分析 SQL Server 的内存为何不断
- SQL Server数据库查询速度慢的原
- 详细讲解删除SQL Server日志的具
- 三步骤快速创建SQL Server数据库
- SQL Server事务日志的几个常用操
- SQLServer应用程序中的高级SQL注
- 使用SQL Server 2008进行服务器
阅览排行
教你创建动态MSSQL数据库表
www.jz123.cn 2009-06-23 来源: 中国建站 责任编辑(袁袁) 我要投递新闻
下面是利用SQL语句创建数据库、表、存储过程、视图、索引、规则、修改表、查看数据等的方法。所要增加的控件如下:
以下是引用片段:
Imports System.Data Imports System.Data.SqlClient Public Class Form1 Inherits System.Windows.Forms.Form Private ConnectionString As String = "Data Source=.;Initial Catalog=;User Id=sa;Password=;" Private reader As SqlDataReader = Nothing Private conn As SqlConnection = Nothing Private cmd As SqlCommand = Nothing Private AlterTableBtn As System.Windows.Forms.Button Private sql As String = Nothing Private CreateOthersBtn As System.Windows.Forms.Button #Region " Windows 窗体设计器生成的代码 " '窗体重写处置以清理组件列表。 Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub Public Sub New() MyBase.New() InitializeComponent() End Sub Private components As System.ComponentModel.IContainer Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid Friend WithEvents CreateDBBtn As System.Windows.Forms.Button Friend WithEvents CreateTableBtn As System.Windows.Forms.Button Friend WithEvents CreateSPBtn As System.Windows.Forms.Button Friend WithEvents CreateViewBtn As System.Windows.Forms.Button Friend WithEvents btnAlterTable As System.Windows.Forms.Button Friend WithEvents btnCreateOthers As System.Windows.Forms.Button Friend WithEvents btnDropTable As System.Windows.Forms.Button Friend WithEvents btnViewData As System.Windows.Forms.Button Friend WithEvents btnViewSP As System.Windows.Forms.Button Friend WithEvents btnViewView As System.Windows.Forms.Button Private Sub InitializeComponent() |
0
上一篇:SQL数据库挂马解决方案 下一篇:详解SQLServer 存储过程