<%@ webservice Language="vb" Class="DBSrc_vb" %> 
Imports System
Imports System.Web
Imports System.Web.Services
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.OleDb
Imports Microsoft.VisualBasic
public class DBSrc_vb
	<WebMethod()>public Function GetSQLData(ServerName as string , uid as string,Password as string ,DBName as string ,TBName as string ) as Dataset
		dim d as string = "server=" & ServerName & ";uid=" & uid & ";pwd=" & Password & ";database=" & DBName
		Dim NowConn as SqlConnection = new SqlConnection(d)
		Dim DS as DataSet = new DataSet()
		dim k as string = "SELECT * From " & TBName
		Dim NComm as SqlDataAdapter = new SqlDataAdapter(k, NowConn)
		NComm.Fill(DS, TBName)
		return DS
	end function
	<WebMethod()>public Function SaveSQLData(DS as DataSet ,ServerName as string ,uid as string ,Password as string ,DBName as string ,TBName as string) as Boolean
		dim d as string = "server=" & ServerName & ";uid=" & uid & ";pwd=" & Password & ";database=" & DBName 
		Dim NowConn as SqlConnection  = new SqlConnection(d)
		Dim k as string = "SELECT * From " & TBName
		Dim NComm as SqlDataAdapter = new SqlDataAdapter(k, NowConn)
		try
			Dim custCB as SqlCommandBuilder = new SqlCommandBuilder(NComm)
			NComm.Update(DS,TBName)
			return -1
		catch
			return 0
		end try
	End Function

end class
