ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 11th, 2003, 12:46 PM
hotel_project hotel_project is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 17 hotel_project User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question ADO.NET with sql server 2000

Hi every body...Well I tried the codes of ADO.NET with sql server 2000 but it gives me this message sql server doesn't exist or access denied !!!!!


So What is the solution for this situation???
Although I mentioned the UID n PWD in the code of ADO.NET

Thanks

Reply With Quote
  #2  
Old May 13th, 2003, 02:56 PM
cinners cinners is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Pennsylvania
Posts: 30 cinners User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
check to make sure you have permissions to the database, stored procedures, and you are in the proper user group for access to the server. ? Are you developing in a test server or live server also check you connections strings


Private Sub Insert_Employee_Phone_Directory()
Dim cmdResults As String
'TEST CONNECTION
'Dim strCon As String = ("Integrated Security=SSPI;" & _
' "Data Source=CSDEV-SQL1;" & _
' "Initial Catalog=Personnel")

NOTE: CSDEV IS THE DEVELOPMENT SERVER
PERSONNEL IS THE DATABASE
Employee_Phone_Directory IS THE DATABASE TABEL

'*** LIVE CONNECTION *********
Dim strcon As String = ("Integrated Security=SSPI;" & _
"Data Source=CS-SQL1;" & _
"Initial Catalog=Personnel")

'COMMENT OUT TEST COMMECTION AND UNCOMMENT THE ABOVE CODE FOR A LIVE CONNECTION *****

Dim cn As New SqlConnection(strCon)
Try
cn.Open()
Catch er As System.Exception
MsgBox(er.Message)
End Try
'*** SROTED PROCEDURE FOR Insert A RECORD ******

Dim cmd As New SqlCommand("usp_Insert_Employee_Phone_Directory", cn)

With cmd
cmd.CommandType = CommandType.StoredProcedure
.CommandText = "usp_Update_Employee_Phone_Directory"
.Parameters.Add("@PerFix", cobPreFix.Text)
.Parameters.Add("@Last_Name", txtLastName.Text)
.Parameters.Add("@First_Name", txtFirstName.Text)
.Parameters.Add("@Initial", txtInitial.Text)
.Parameters.Add("@suffix", cobSuffix.Text)
.Parameters.Add("@Bureau", cobBureau.Text)
.Parameters.Add("@Division", cobDivision.Text)
.Parameters.Add("@Title", cobTitle.Text)
.Parameters.Add("@Phone_Number", txtphone.CtlText)
.Parameters.Add("@Intercom", txtExtension.Text)
.Parameters.Add("@Fax_Number", txtFax.CtlText)
.Parameters.Add("@TDD_Number", txtTdd.CtlText)
.Parameters.Add("@Email_Address", txtEmail.Text)
End With
Try
cmd.ExecuteNonQuery()
Catch e As Exception
MsgBox(e.Message)
End Try

If cmdResults = 0 Then
MsgBox("Record Has Been Added", MsgBoxStyle.OKOnly, "Record Insert")
Call Clear_Input()
Exit Sub
Else
MsgBox("Insert Failed", MsgBoxStyle.OKOnly, "Record Update Error")
End If
End Sub

HOPE THIS HELPS YOU !

Reply With Quote
  #3  
Old June 2nd, 2003, 11:49 AM
James Yang James Yang is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Atlanta, Georgia
Posts: 284 James Yang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 45 sec
Reputation Power: 7
Send a message via ICQ to James Yang
its most likely that you have set up ur sql server as windows integrated security change that. go to property section of your server . (in Enterprise Mangaer)
__________________
Regards,

James Yang
.NET Developer / Network Engineer
MCSE, MCDBA, MCSA, CCNA

http://www.yellowpin.com/
http://www.opentechsupport.com/

Reply With Quote
  #4  
Old June 5th, 2003, 05:17 AM
himanshus16 himanshus16 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: New Delhi, INDIA
Posts: 7 himanshus16 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

You can try this code to establish a connection to the SQL server (Using SQL Authentication) instead of Windows authentication, as you are currently doing.

You can try the following code to connect:

dim con as new sqlclient.sqlConnection

with con
.connectionstring="user id=<Username> ;password=<Password> ;data source=<server name> ;initial catalog=<SQL Database Name>"
.open
end with

But, before that check that both client and server machines are on network.

The above code should work.

regards,

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > ADO.NET with sql server 2000


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT