|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How can i connect to my SQL database from my vb.net asp.net web application and my c# asp.net web application?
![]() |
|
#2
|
|||
|
|||
|
by the way, i'm refering to MS SQL Server
![]() |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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' |
|
#5
|
|||
|
|||
|
im using stored procedures for this, btw
![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > connecting asp.net web application from vb.net and c# to SQL server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|