.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET 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 December 11th, 2004, 10:58 PM
cookie cookie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 cookie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question connecting asp.net web application from vb.net and c# to SQL server

How can i connect to my SQL database from my vb.net asp.net web application and my c# asp.net web application?

Reply With Quote
  #2  
Old December 22nd, 2004, 04:33 AM
cookie cookie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 cookie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile MS SQL Server

by the way, i'm refering to MS SQL Server

Reply With Quote
  #3  
Old December 27th, 2004, 02:24 AM
DSD DSD is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 1 DSD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ASP.NET with SQL SERVER

Imports System.Data.SqlClient



Public Class Form1 Inherits System.Windows.Forms.Form

Dim SqlConn As SqlConnection

Dim SqlDA As SqlDataAdapter

Dim SQLDS As DataSet

Dim DRow As DataRow


connectstring="Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=mySQLServe r"

Private Sub Form1_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

SqlConn = new SqlConnection("connection String")

SqlDA = new SqlDataAdapter("SqlQuery",SqlConn)

SqlDA.Fill(DS,"Any Name for the Reference")



For Each DRow In ds.Tables ("Customer").Rows

ComboBox1.Items.Add (DRow("Customer_Name"))

Next

End Sub

End Class

Reply With Quote
  #4  
Old December 29th, 2004, 08:22 AM
cookie cookie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 cookie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile error in code

thanks for the code

i'm having problems with the code though:

SqlConn = New SqlConnection(connectstring)
--> Too many arguments to 'Public Sub New()'

SqlDA = New SqlDataAdapter(querry, SqlConn)
--> Overload resolution failed because no accessible 'New' can be called with these arguments:
'Public Sub New(selectCommandText As String, selectConnection As System.Data.SqlClient)': Value of type 'mySC_VB.SqlConnection' cannot be converted to 'System.Data.SqlClient.SqlConnection'
'Public Sub New(selectCommandText As String, selectConnectionString As String'): Value of type 'mySC_VB.SqlConnection' cannot be converted to 'String'

Reply With Quote
  #5  
Old December 29th, 2004, 08:23 AM
cookie cookie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 cookie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile stored procs

im using stored procedures for this, btw

Reply With Quote
  #6  
Old April 2nd, 2010, 03:12 AM
SNK111 SNK111 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2010
Posts: 14 SNK111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 4 m 30 sec
Reputation Power: 0
Connecting to SQL Server from C#.NET and more..

Check this link EMBEDDING SQL IN C#.NET for details on how to connect to SQL server database from C#.NET database applications as well as Java database applications. It also describes how to pass embedded SQL queries, calling stored procedures, pass parameter etc.

Shahriar Nour Khondokar Shahriar Nour Khondokar[/URL]

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > connecting asp.net web application from vb.net and c# to SQL server


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap