•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 402,906 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,123 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 2425 | Replies: 0
![]() |
| |
•
•
Join Date: Feb 2007
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 0
Anyone can help me as soon as possible.
I want to create table on my database. i tried Following code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim ConStr As String = "Data Source=Urjit6;Initial Catalog=MyDB;Integrated Security=True"
Dim MyCon As New SqlConnection(ConStr)
Dim SqlCom As New SqlCommand
Dim server As New Server(New ServerConnection(MyCon))
'Create object for database
Dim db As Database = server.Databases("MyDB")
'Create Table
Dim newTab As New Table(db, "NewTab")
'Add Columns in table
Dim idCol As New Column(newTab, "ID")
idCol.DataType = DataType.Int
idCol.Nullable = False
idCol.Identity = True
idCol.IdentitySeed = 1
idCol.IdentityIncrement = 1
Dim nameCol As New Column(newTab, "Name")
nameCol.DataType = DataType.VarChar(20)
nameCol.Nullable = False
newTab.Columns.Add(idCol)
newTab.Columns.Add(nameCol)
l1.Text="Table is Created"
newTab.Create()
and I got error
Server Error in '/asp/DataCon' Application.
--------------------------------------------------------------------------------
Property DefaultSchema is not available for Database '[MyDB]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.SqlServer.Management.Smo.PropertyCannotB eRetrievedException: Property DefaultSchema is not available for Database '[MyDB]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.
Source Error:
Line 24:
Line 25: 'Create Table
Line 26: Dim newTab As New Table(db, "NewTab")
Line 27:
Line 28: 'Add Columns in table
I have granted all permission of my database[MyDB] except connect.
what can I do for create table.
I want to create table on my database. i tried Following code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim ConStr As String = "Data Source=Urjit6;Initial Catalog=MyDB;Integrated Security=True"
Dim MyCon As New SqlConnection(ConStr)
Dim SqlCom As New SqlCommand
Dim server As New Server(New ServerConnection(MyCon))
'Create object for database
Dim db As Database = server.Databases("MyDB")
'Create Table
Dim newTab As New Table(db, "NewTab")
'Add Columns in table
Dim idCol As New Column(newTab, "ID")
idCol.DataType = DataType.Int
idCol.Nullable = False
idCol.Identity = True
idCol.IdentitySeed = 1
idCol.IdentityIncrement = 1
Dim nameCol As New Column(newTab, "Name")
nameCol.DataType = DataType.VarChar(20)
nameCol.Nullable = False
newTab.Columns.Add(idCol)
newTab.Columns.Add(nameCol)
l1.Text="Table is Created"
newTab.Create()
and I got error
Server Error in '/asp/DataCon' Application.
--------------------------------------------------------------------------------
Property DefaultSchema is not available for Database '[MyDB]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.SqlServer.Management.Smo.PropertyCannotB eRetrievedException: Property DefaultSchema is not available for Database '[MyDB]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.
Source Error:
Line 24:
Line 25: 'Create Table
Line 26: Dim newTab As New Table(db, "NewTab")
Line 27:
Line 28: 'Add Columns in table
I have granted all permission of my database[MyDB] except connect.
what can I do for create table.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access ajax asp code coding combo competition compilers computer custom data developer developers development dom dropdownlist errors feed google gpt guid partition table languages microsoft module msdn net office partition programming reader reuse sans search security skin software sql theme vista weather web windows workflow xml xoap
- Simple ASP.Net Login Page using C# (C#)
- Updated : Simple ASP.Net Login Page (ASP.NET)
- ideas about projects in asp.net (ASP.NET)
- ASP.Net Error with C# Coding (C#)
- ASP.NET Registration Page (ASP.NET)
- plz help me to connect more than one table in the ms access database to the asp.net (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Export to Excel from ASP.NET app
- Next Thread: SqlDataReader is not working.


Hybrid Mode