Prev: Charge Item
Next: Date not valid
From: Andy Tang on 28 Apr 2005 06:14 Hi Need help! I am trying to use the odbc to connect to a native database thru the web using asp.net code. code <%@ WebService language="VB" class="NavisionItems" %> Imports System Imports System.Web.Services Imports System.Xml.Serialization Public Class NavisionItems <webmethod>Function GetNavisionItems() As System.Data.DataSet Dim connectionString As String = "DSN=nav40;UID=admin;pwd=admin" Dim dbConnection As new System.Data.odbc.odbcConnection(connectionString) Dim queryString As String = "select * from test" Dim dbCommand As System.Data.odbc.odbcCommand = New System.Data.odbc.odbcCommand dbconnection.open() 'dbCommand.CommandText = queryString 'dbCommand.Connection = dbConnection 'Dim dataAdapter As System.Data.odbc.odbcDataAdapter = New System.Data.odbc.odbcDataAdapter 'dataAdapter.SelectCommand = dbCommand Dim dataSet As System.Data.DataSet = New System.Data.DataSet 'dataAdapter.Fill(dataSet) Return dataSet End Function End Class thanks
|
Pages: 1 Prev: Charge Item Next: Date not valid |