Home > Computer Tutorials > Computer Knowledge > How to transfer local SQL database to remote SQL using VB

How to transfer local SQL database to remote SQL using VB

WBOY
Release: 2024-01-23 08:09:15
forward
1398 people have browsed it

How to transfer local SQL database to remote SQL using VB

How to transfer local SQL database to remote SQL using VB

Make sure your space has a data service connection

Source error:

Line 29: ConnectionStringSettings setting = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"];

Line 30: myCon.ConnectionString = setting.ConnectionString;

Line 31: myCon.Open();

Line 32:

Line 33: //2 Use SqlCommand to submit query command

Source file: d:\root\3g1008688_com\web\Default2.aspx.cs Line: 31

Your file here is not uploaded to the server, recheck whether the database operation file is uploaded completely

How to connect VB NET to the database

Imports System.Data

Imports System.Data.SqlClient

Module connect to database

Public Server1 As String

Public DataBase1 As String

Public Function GetTable(ByVal sqlstr$) As DataTable

Dim SqlConn As SqlConnection = New SqlConnection("server=" & Server1 & ";database="" & DataBase1 & ";integrated security=true") 'Declare these SQL classes

Dim facDataAdapter As SqlDataAdapter = New SqlDataAdapter

Dim SqlComm As SqlCommand = New SqlCommand(sqlstr, SqlConn)

facDataAdapter.SelectCommand = SqlComm

Dim dt As DataTable = New DataTable

facDataAdapter.Fill(dt)

Return dt

End Function

End Module

The above is the detailed content of How to transfer local SQL database to remote SQL using VB. For more information, please follow other related articles on the PHP Chinese website!

source:docexcel.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template