Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Creating database through vb.net

Creating database through vb.net

Scheduled Pinned Locked Moved Visual Basic
databasequestioncsharp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kashif Sabir
    wrote on last edited by
    #1

    i have created database in sqlserver through vb it was created successfully but when i go in enterprise manager for making query the table which were created are showing no columns i.e only All columns selection check box is there what is wrong with database? When i execute select query the result pane showing all columns but no columns in the table structure above MKS

    D P 2 Replies Last reply
    0
    • K Kashif Sabir

      i have created database in sqlserver through vb it was created successfully but when i go in enterprise manager for making query the table which were created are showing no columns i.e only All columns selection check box is there what is wrong with database? When i execute select query the result pane showing all columns but no columns in the table structure above MKS

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      We'd need to see the code that created the table.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      K 1 Reply Last reply
      0
      • K Kashif Sabir

        i have created database in sqlserver through vb it was created successfully but when i go in enterprise manager for making query the table which were created are showing no columns i.e only All columns selection check box is there what is wrong with database? When i execute select query the result pane showing all columns but no columns in the table structure above MKS

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #3

        Show the code like Dave recommended.

        "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          We'd need to see the code that created the table.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          K Offline
          K Offline
          Kashif Sabir
          wrote on last edited by
          #4

          Sorry for replying late Following is the code for creating database please reply. This is how i create the data base and table. Public Function Create_UserDB(strDBFolder As String, strDBName As String, isDoubleAccounting As Boolean, isGLInclude As Boolean) As Boolean Dim strQuery As String Create_UserDB = False strQuery = "CREATE DATABASE [" & strDBName & "] " strQuery = strQuery & " ON (NAME = N'RWSDB_Data', FILENAME = N'" & strDBFolder & "\" & strDBName & ".mdf' " strQuery = strQuery & " , SIZE = 3, FILEGROWTH = 10%) LOG " strQuery = strQuery & " ON (NAME = N'RWSDB_Log', FILENAME = N'" & strDBFolder & "\" & strDBName & ".ldf' " strQuery = strQuery & " , SIZE = 1, FILEGROWTH = 10%)" ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'autoclose', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'bulkcopy', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'trunc. log', N'true'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'torn page detection', N'true'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'read only', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'dbo use', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'single', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'autoshrink', N'true'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'ANSI null default', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'recursive triggers', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'ANSI nulls', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'concat null yields null', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'cursor close on commit', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'default to local cursor', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'quoted identifier', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'ANSI warnings', N'false'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "', N'auto create statistics', N'true'": ExecuteQuery strQuery strQuery = "exec sp_dboption N'" & strDBName & "',

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups