首页 | 源码下载 | 网站模板 | 网页特效 | 广告代码 | 网页素材 | 字体下载 | 书库 | 站长工具
会员投稿 投稿指南 RSS订阅
当前位置:主页>网络编程>SQL server>资讯:教你创建动态MSSQL数据库表

教你创建动态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()

上一篇:SQL数据库挂马解决方案 下一篇:详解SQLServer 存储过程

评论总数:0 [ 查看全部 ] 网友评论


关于我们隐私版权广告服务友情链接联系我们网站地图