code_junkie

Return Object From Webservice

Nov 13th, 2011
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. sqlConn.ConnectionString = GetConnString(Database);
  2.  
  3. // build query
  4. string strSQL = @" SELECT [No_] AS [VendorNo],
  5. LTRIM([Name]) AS [VendorName]
  6.  
  7. FROM [********_$Vendor]
  8.  
  9. WHERE LEN(RTRIM([Name])) > 0 /* avoid blank names */
  10.  
  11. AND [Vendor Posting Group] = 'VEND'
  12.  
  13. ORDER BY LTRIM([Name]) ASC; /* LTRIM fixes spaces before name */ ";
  14.  
  15. SqlDataAdapter da = new SqlDataAdapter(strSQL, sqlConn);
  16.  
  17. DataSet ds = new DataSet();
  18.  
  19. da.Fill(ds, "Vendors");
  20.  
  21. return (ds);
  22. }
Add Comment
Please, Sign In to add comment