PDA

View Full Version : مشکل در وارد کردن جداول



Al.Nop
پنج شنبه 22 مرداد 1388, 16:05 عصر
سلام:لبخندساده:
من روی هاست کار می کنم . در قسمت DataBase پلسک کلیک کردم و Add New DataBase رو زدم و بانکی به نام admin_shop ایجاد کردم . وسپس کد زیر رو برای افزودن جداول استفاده کردم ( در یک فایل asp.net ) :

Imports System.Data.SqlClient
Partial Class sql
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim q As String = "CREATE TABLE users ( " & _
"userid int NOT NULL IDENTITY(1, 1) ," & _
"username nvarchar(50) NOT NULL ," & _
"pass nvarchar(50) NOT NULL ," & _
"mail nvarchar(50) NOT NULL ," & _
"adress nvarchar(max) NOT NULL ," & _
"ip nvarchar(50) NOT NULL," & _
"active nvarchar(50) NOT NULL," & _
"PRIMARY KEY (userid))" & _
"CREATE TABLE fp ( " & _
"id int NOT NULL IDENTITY(1, 1) ," & _
"prid int NOT NULL ," & _
"quantity int NOT NULL ," & _
"ip nvarchar(50) NOT NULL ," & _
"username nvarchar(max) NOT NULL ," & _
"rah nvarchar(50) NOT NULL," & _
"PRIMARY KEY (id))" & _
"CREATE TABLE pr ( " & _
"id int NOT NULL IDENTITY(1, 1) ," & _
"name nvarchar(50) NOT NULL ," & _
"price decimal(18,0) NOT NULL ," & _
"Image nvarchar(50) NOT NULL ," & _
"PRIMARY KEY (id))" & _
"CREATE TABLE se ( " & _
"id int NOT NULL IDENTITY(1, 1) ," & _
"rah nvarchar(max) NOT NULL ," & _
"price nvarchar(50) NOT NULL ," & _
"ip nvarchar(max) NOT NULL ," & _
"username nvarchar(50) NOT NULL ," & _
"PRIMARY KEY (id))"
Dim b As String = "Data Source=.\SQLEXPRESS;Initial Catalog=shop;Integrated Security=True"
Dim con As New SqlConnection(b)
Dim cmd As New SqlCommand(q, con)
con.Open()
Try
cmd.ExecuteNonQuery()
Response.Write("Query Was Good!")
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
End Class


و سپس فایل رو اجرا کردم تا Query اجرا بشه ولی متاسفانه خطای زیر رو نمایش میده :


Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="Off"/> </system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web></configuration>

لطفا کمکم کنید .
مرسی:چشمک:

Al.Nop
جمعه 23 مرداد 1388, 12:23 عصر
Any Help:متفکر: