Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: How to get all fields value of the datagrid?
william xie
Posts: 28
 
How to get all fields value of the datagrid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Sep 06 10:57 PM
fiogf49gjkf0d
I need to read all column value of the datagrid in each row, how to implement it?
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: How to get all fields value of the datagrid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Sep 06 9:50 AM
fiogf49gjkf0d
Use the datagrid's recordset and loop thru that.
--
rjl
[Reply][Quote]
Jason McCormack
Posts: 8
 
Re: How to get all fields value of the datagrid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Sep 06 1:14 AM
fiogf49gjkf0d
Here is a sample.

Jason


If objRS.RecordCount > 0 Then
While Not objRS.BOF And Not objRS.EOF
ReDim arrColumns(objRS.Fields.Count - 1, 4)

For Each objField In objRS.Fields
arrColumns(i, 0) = objField.Name 'Column Name
arrColumns(i, 1) = "" 'Column Value (Typically blank at this point)
arrColumns(i, 2) = objField.Type 'Column Data Type
arrColumns(i, 3) = objField.DefinedSize 'Column Width (String,Char,Varchar)
arrColumns(i, 4) = "" 'objField.adFldIsNullable

i = i + 1
Next

objRS.MoveNext
Wend
End If
[Reply][Quote]
Jason McCormack
Posts: 8
 
Re: How to get all fields value of the datagrid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Sep 06 1:17 AM
fiogf49gjkf0d
Sorry. Formatting didn't stick when using "<code>" tag. Guess I should have used "<pre>"
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: How to get all fields value of the datagrid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Sep 06 12:06 AM
fiogf49gjkf0d
Nice post...
General FYI for folks on ADO, recordsets, etc...
Get a copy of David Sussman's book: ADO Programming Reference. It's the Technical Bible on ADO and it's what the SalesLogis folks use as well.

--
rjl
[Reply][Quote]
Jason McCormack
Posts: 8
 
Re: How to get all fields value of the datagrid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Sep 06 12:25 AM
fiogf49gjkf0d
One thing I should have mentioned, is that this code is from a function I use, so that is why there might be some comments and other things that seem a bit out of place. It was just a quick sample to get an idea of how to loop through each of the columns in each row of a resultset.

In addition to RJL's recommendation, I have found the MSDN reference to be quite helpful. Keep in mind that the link is current as of today (2006-09-14), but I find they have been moving things around on MSDN. So if you don't get the reference at the link below, a quick search for "ADO Reference" should get you to the new location.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmscadoapireference.asp

Jason
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/26/2024 4:20:16 PM