ManuAntibes
Messages postés491Date d'inscriptionmardi 24 octobre 2000StatutMembreDernière intervention18 novembre 2021
-
14 mars 2007 à 22:15
ManuAntibes
Messages postés491Date d'inscriptionmardi 24 octobre 2000StatutMembreDernière intervention18 novembre 2021
-
17 mars 2007 à 11:56
J'y arrive très bien , mais Je souhaite faire la même chose avec une base Access ou ODBC et là par contre j'ai une erreur que je n'arrive pas à resoudre.
System.Data.OleDb.OleDbException: Type de données incompatible dans l'expression du critère. à System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) à System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) à System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) à System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) à System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) à System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) à System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) à System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) à System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) à System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) à ClassArticle.ListeDataSetArticle(Int32 mag) dans C:\Documents and Settings\manu\Mes documents\WebServiceArticle\App_Code\Service.vb:ligne 21
la ligne 21 est : custDa.Fill(custDs, "DBA_articles")
Je vous donne mon code :
Imports System.data
Imports System.Data.OleDb
Imports System.Web.Services
<WebService(Namespace:="http://tempuri.org/")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
_Public Class ClassArticleInherits
Public TableArticleConn As OleDbConnection = New OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Application\DBx.mdb")
<WebMethod()>
PublicFunction ListeDataSetArticle(ByVal mag AsInteger) As DataSetDim custDa As OleDbDataAdapter New OleDbDataAdapter("SELECT [CODE_RAYON], [CODE_PLU], [CODE_EAN], [DESIGNATION], [PV1], [TVA1], [FAMILLE], [TARE] FROM [DBA_articles] WHERE CODE_RAYON'" & mag & "'", TableArticleConn)
Dim custDs As DataSet = New DataSet()
custDa.MissingSchemaAction = MissingSchemaAction.AddWithKey
custDa.Fill(custDs, "DBA_articles")
ListeDataSetArticle = custDsEndFunctionEndClass
ManuAntibes
Messages postés491Date d'inscriptionmardi 24 octobre 2000StatutMembreDernière intervention18 novembre 20215 17 mars 2007 à 11:56
en faite sur un autre forum on m'a donné la reponseDim custDa As OleDbDataAdapter New OleDbDataAdapter("SELECT [CODE_RAYON], [CODE_PLU], [CODE_EAN], [DESIGNATION], [PV1], [TVA1], [FAMILLE], [TARE] FROM [DBA_articles] WHERE CODE_RAYON " + mag.ToString, TableArticleConn)
mais je testerais le coup des apostrophes
En tous cas merci
Tu t'y connais en IIS car j'ai posté une question sur IIS 5.1.
encore merci @+