Creating database through vb.net
-
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
-
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
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 -
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
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
-
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, 2007Sorry 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 & "',