PDA

View Full Version : Failed in reading ProductCode data from Volusion



psaad
01-10-2013, 09:17 AM
Any help would be GREATLY appreciated!

This is the code in VB.net



************************************************** ********
Dim Xml_Returned As String
Using myWebClient As New System.Net.WebClient
' Set one of the headers.
myWebClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
myWebClient.Headers.Add("Content-Action", "Volusion_API")

' Download data.
Dim myDatabuffer() As Byte = myWebClient.DownloadData("http:/DOMAINNAME.com/net/WebService.aspx?Login=xxxx@xxxx.com&EncryptedPassword=yyyyyyyy&API_Name=Generic\\Products&SELECT_Columns=p.ProductCode")

' Result.
Response.Write(myDatabuffer.Length)
Xml_Returned = System.Text.Encoding.ASCII.GetString(myDatabuffer)
Response.Write(Xml_Returned)



myDatabuffer = Nothing

'Console.WriteLine(arr.Length)
'Console.WriteLine(client.ResponseHeaders("Content-Encoding"))
End Using
************************************************** ********


And I am getting this error msg:



Xml_Returned "<?xml version="1.0" encoding="utf-8" ?> <ReturnResult> <Success>False</Success>
<Message>System.Data.SqlClient.SqlException: Invalid object name 'vMerchant.tbl_EDI_Log_Generic__Products'.
at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolean breakConnection) at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) at
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader
dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at
System.Data.SqlClient.SqlDataReader.ConsumeMetaDat a() at
System.Data.SqlClient.SqlDataReader.get_MetaData() at
System.Data.SqlClient.SqlCommand.FinishExecuteRead er(SqlDataReader ds, RunBehavior runBehavior, String
resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderT ds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior cmdBehavior, RunBehavior
runBehavior, Boolean returnStream, String method, DbAsyncResult result) at
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior cmdBehavior, RunBehavior
runBehavior, Boolean returnStream, String method) at
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior, String method) at
System.Data.SqlClient.SqlCommand.ExecuteDbDataRead er(CommandBehavior behavior) at
System.Data.Common.DbCommand.System.Data.IDbComman d.ExecuteReader(CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable,
IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at Sql_Misc50.Class_SQL50.ExecuteSQLTextReturnDataset _MsSQL(Object&amp;amp; SqlConnection_,
String&amp;amp; sSQL, Boolean bDispose, Boolean bLog_SQL_Usage, Object[]&amp;amp; SqlParameters,
String sXsdPath, String sTimeOut) DECLARE @RunDate datetime;SET
@RunDate=CONVERT(DATETIME, '2013-01-10 10:39:57', 102); DECLARE @LastRunDate datetime;
SET @LastRunDate = ISNULL((SELECT MAX(RunDate) FROM [vMerchant].[tbl_EDI_Log_Generic__Products]),
CAST('1/1/2000' AS datetime)) -- DELETE FROM THE LOG FILE IF THEY HAVE BEEN UPDATED DELETE FROM
[vMerchant].[tbl_EDI_Log_Generic__Products] WHERE [ID_Log] IN (SELECT ProductID FROM [vMerchant].Products
WHERE LastModified &amp;gt; @LastRunDate); -- INSERT INTO [vMerchant].[tbl_EDI_Log_Generic__Products]
([ID_Log], [RunDate]) SELECT TOP 100 p.ProductID, @RunDate FROM vMerchant.Products p INNER JOIN
vMerchant.Products_Descriptions pd ON p.ProductID = pd.ProductID INNER JOIN vMerchant.Products_Extended
pe ON p.ProductID = pe.ProductID INNER JOIN vMerchant.Products_Memos pm ON p.ProductID = pm.ProductID
WHERE p.ProductID NOT IN (SELECT [ID_Log] FROM [vMerchant].tbl_EDI_Log_Generic__Products) -- SELECT
p.ProductCode, p.ProductID FROM vMerchant.Products p INNER JOIN
vMerchant.Products_Descriptions pd ON p.ProductID = pd.ProductID INNER JOIN vMerchant.Products_Extended
pe ON p.ProductID = pe.ProductID INNER JOIN vMerchant.Products_Memos pm ON p.ProductID = pm.ProductID
INNER JOIN [vMerchant].[tbl_EDI_Log_Generic__Products] l ON p.ProductID = l.ID_Log WHERE l.
[RunDate]=@RunDate; </Message> </ReturnResult>" String


Thanks for your help!
Pat

Marc_NY
01-10-2013, 09:49 AM
Can't help you in .NET but can help if you want it in classic ASP.

psaad
01-11-2013, 07:26 AM
Can't help you in .NET but can help if you want it in classic ASP.

Thanks Marc! I presume someone must be an expert in .net :)

psaad
01-11-2013, 09:08 AM
Can't help you in .NET but can help if you want it in classic ASP.

Actually Marc, would you be able to replicate our sql request using code in ASP? If so, would you be able to guide me in doing so?

Thanks