home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

PROBLEMS ACCESSING SQL SERVER ON SAME DESKTOP

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2698
Discussions: 200,965, Posts: 2,379,621, Members: 246,332
Old May 15th, 2004, 12:34 PM   Digg it!   #1 (permalink)
Member
 
Join Date: Mar 2004
Posts: 35
PROBLEMS ACCESSING SQL SERVER ON SAME DESKTOP

Hi I am new to vb.net and ASP.

I am running SQL2000 and Visual Studio.net on the same computer (I Don't know if this is a problem)

I am having problems fine tuning the SQL server. I am using MS SQL 2000 and have downloaded the MS SQL Server

Desktop Engine to run SQL server manager.I am having problems accessing the database fields from the SQL

server.I used the Import and Export data feature to export the MS Access db to the OLE Provider for SQL.

Question 1 : When I click the server listbox to select the servers , none appear. I type in (local) and a

list of databases appears in the Database listbox. Shouldn't the servers already be present in the server listbox

? Is this the reason why My progarmme is not running properly? Are servers active or not?????

Please review my code in conjunctiion with the SQL Server Querry .Also please advice me on setting the SQL
server Group in the SQL Server Enterprise Manager - Is this where you fine tune your SQL Server??

One more question what are ASMX files used for?

I would really appreciate any help on this topic

THANK YOU

Imports System

Imports System.Data

Imports System.Data.SqlClient





Public Class WebForm1

Inherits System.Web.UI.Page



#Region " Web Form Designer Generated Code "



'This call is required by the Web Form Designer.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

Dim configurationAppSettings As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader

Me.cn = New System.Data.SqlClient.SqlConnection

Me.cd = New System.Data.SqlClient.SqlCommand

'

'cn

'

Me.cn.ConnectionString = CType(configurationAppSettings.GetValue("cn.Connec tionString", GetType(System.String)), String)

'

'cd

'

Me.cd.CommandText = "SELECT Aircraft.* FROM Aircraft WHERE ([Aircraft- id] = @AircraftID)"

Me.cd.Connection = Me.cn

Me.cd.Parameters.Add(New System.Data.SqlClient.SqlParameter("Parameter1", System.Data.SqlDbType.NVarChar))



End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents Label2 As System.Web.UI.WebControls.Label

Protected WithEvents Label3 As System.Web.UI.WebControls.Label

Protected WithEvents Label4 As System.Web.UI.WebControls.Label

Protected WithEvents bntFind As System.Web.UI.WebControls.Button

Protected WithEvents bntCreate As System.Web.UI.WebControls.Button

Protected WithEvents btnUpdate As System.Web.UI.WebControls.Button

Protected WithEvents btnDelete As System.Web.UI.WebControls.Button

Protected WithEvents btnBookings As System.Web.UI.WebControls.Button

Protected WithEvents txtID As System.Web.UI.WebControls.TextBox

Protected WithEvents txtSurname As System.Web.UI.WebControls.TextBox

Protected WithEvents txtForename As System.Web.UI.WebControls.TextBox

Protected WithEvents txtTitle As System.Web.UI.WebControls.TextBox

Protected WithEvents lblError As System.Web.UI.WebControls.Label

Protected WithEvents cn As System.Data.SqlClient.SqlConnection

Protected WithEvents cd As System.Data.SqlClient.SqlCommand



'NOTE: The following placeholder declaration is required by the Web Form Designer.

'Do not delete or move it.

Private designerPlaceholderDeclaration As System.Object



Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

End Sub



#End Region



Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load



End Sub



Private Sub bntFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntFind.Click



Dim AircraftID As String = txtID.Text

Dim dr As SqlDataReader

Dim cn As New SqlConnection

Dim cd As New SqlCommand





Try

cn.ConnectionString = "Data Source=local"

cd.Connection = cn

cd.CommandText = "select Aircraft-id, Registration ,Manufacture,Model from Aircraft where Aircraft-id = " + AircraftID

cn.Open()

dr = cd.ExecuteReader

dr.Read()

txtID.Text = dr("Aircraft-id").ToString

txtTitle.Text = dr("Registration").ToString

txtForename.Text = dr("Manufacture").ToString

txtSurname.Text = dr("Model").ToString

Catch

lblError.Text = "Unable to find details for aircraft" + " " + AircraftID

Finally

If Not dr Is Nothing Then dr.Close()

cn.Close()

End Try

End Sub





Private Sub cn_InfoMessage(ByVal sender As System.Object, ByVal e As System.Data.SqlClient.SqlInfoMessageEventArgs)



End Sub

End Class
musictoad is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Visual Studio 6 compatible with Windows 2003 Server? SeanC Applications and Operating Systems 2 July 23rd, 2003 12:10 PM
Running SQl server Scripts Sunayana Webmastering and Programming 2 October 25th, 2002 06:01 PM
VB Desktop Application Accessing SQL Server on Web Server imd Webmastering and Programming 1 October 24th, 2002 02:21 PM
who/what uses oracle? LinuxNewbie General Tech Discussion 18 September 18th, 2002 11:06 PM
Importing from Access 2002 into mySQL? SpookyEddy Webmastering and Programming 7 January 12th, 2002 12:10 PM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (3006)
Forty-six years ago today (5)
The disrespect of Obama by Russian .. (46)
Laptop with wireless problem. (11)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
Regular Build (11)
Internet Lost (5)
windows 7 problem (7)
windows vista security holes (14)
Point and Shoot Camera Suggestions. (6)
Is the PSU I received dead? (13)
radeon x850xt platinum & shader.. (6)
HIS HD5770 graphic card question (15)
Recent Discussions
Laptop with wireless problem. (11)
Open With ..... Win7 (2)
Internet Lost (5)
Skillsoft Network+ Study Software Que.. (9)
NO GAS (0)
Help getting around port 80 for camer.. (3)
virus blocking exe. files (1)
windows vista security holes (14)
Point and Shoot Camera Suggestions. (6)
CPU fan stops spinning randomly (11)
Nvidia GTX 260 problem (1)
Modern Warfare 2: Who Bought It? (65)
Is the PSU I received dead? (13)
Print spooler problem (16)
Kingston Bluetooth Dongle Driver (1)
Multiple Restarts Required at Boot (3)
webcam (0)
upgrade for hp a6101 (0)
tv not turn on-makes clicking sound (2)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)


All times are GMT -4. The time now is 01:32 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28