Load combo box from XML C# .net

January 17, 2019 2 comments

This is an XML of the format I am using.    Note Text and Value fields for the combo box.

<?xml version="1.0" encoding="UTF-8"?>
<Items>
   <Item>
      <Text>Line 5</Text>
      <Value>L:\plating\line5\</Value>
   </Item>
   <Item>
      <Text>Line 6</Text>
      <Value>L:\plating\line6\</Value>
   </Item>
   <Item>
      <Text>Line 7</Text>
      <Value>L:\plating\line7\</Value>
   </Item>
   <Item>
      <Text>Line 8</Text>
      <Value>L:\plating\line8\</Value>
   </Item>
</Items>

 The following is the c# code.


DataSet ds = new DataSet();
ds.ReadXml("Lines.xml");
comboBox1.DataSource = ds;
comboBox1.DisplayMember = "Item.Text";
comboBox1.ValueMember = "Item.Value";
Categories: .net, c#

Enabling Netuser Id on Iseries

July 18, 2016 Leave a comment

Sometimes Netuser id’s get disabled.       The link is  a way to enable the netuser id from Green Screen.

link at IBM

Categories: ISeries (AS/400)

Recursive SQL statement to read MAPICS Bill of materials

December 11, 2015 Leave a comment

Recursive SQL Statement to read bill of materials, the DEPTH FIRST statement will keep it in sequence.     Otherwise it will be by Level.

WITH temp_pstruc (RELVL, ITEM, QTY) AS
(
SELECT 0, PINBR, 0
FROM AMFLIB.PSTRUC where pinbr = ‘*PUT YOUR PART HERE*’
UNION ALL SELECT a.relvl + 1, b.cinbr, b.qtypr
FROM temp_pstruc AS a join amflib.pstruc AS b
on ITEM = b.pinbr
)
SEARCH DEPTH FIRST BY item SET ORDCOL

SELECT *
FROM temp_pstruc
ORDER BY ORDCOL

Categories: ISeries (AS/400), SQL Tags:

Create a table of table names and fields (DB2)

June 24, 2015 Leave a comment
DROP TABLE LIB.FIELDS;
DROP TABLE LIB.TABLES;
CREATE TABLE LIB.FIELDS AS  (
SELECT DBNAME, SYS_TNAME, SYS_CNAME, NAME, TBNAME, COLNO,
COLTYPE, LENGTH, SCALE, LABELTEXT, PRECISION
 FROM QSYS2.SYSCOLUMNS WHERE DBNAME = ‘LIBRARY’   )
WITH DATA;
CREATE TABLE LIB.TABLES AS (
SELECT * FROM QSYS2.SYSTABLES WHERE DBNAME = ‘LIBRARY’)
WITH DATA;
Categories: Uncategorized Tags: ,

Sorting Iseries (as400) client access transfers by arrival sequence

August 20, 2014 Leave a comment

The IBM doc

http://www-01.ibm.com/support/docview.wss?uid=nas8N1015935

suggest the following to sort a data transfer by arrival sequence or relative record number.     Sometimes the transfer will get confused and randomly pull another access path,  which can cause unexpected results.

RRN(xxxxxx)

Just replace xxxxxx with the file(table) name.

Categories: ISeries (AS/400)

Transfering a user signon to QCTL

January 9, 2014 Leave a comment

This CL can be used on Iseries for a signon job to transfer to qctl.   You must change signon program on user profile.

refer to http://www-01.ibm.com/support/docview.wss?uid=nas8N1010199

0001.00 PGM
0002.00 DCL VAR(&TFR) TYPE(*CHAR) LEN(1)
0003.00 CRTDTAARA DTAARA(QTEMP/LOGON) TYPE(*CHAR) LEN(1)
0004.00 MONMSG MSGID(CPF1023)
0005.00 RTVDTAARA DTAARA(QTEMP/LOGON) RTNVAR(&TFR)
0006.00 IF COND(&TFR = ‘ ‘) THEN(DO) /* There is a blank space between the single quotes */
0007.00 CHGDTAARA DTAARA(QTEMP/LOGON) VALUE(‘N’)
0008.00 TFRJOB JOBQ(QCTL) /* TO TRANSFER TO SUBSYSTEM QCTL*/
0009.00 ENDDO
0010.00 ENDPGM

Categories: ISeries (AS/400)

Automatic Iseries Navigator connections

December 28, 2012 Leave a comment

The cwblogon program in client access will open a connection to an Iseries/as400.     This allows the connection properties is to “prompt as needed”,  no other password will need to be entered.

CWBLOGON system /u userid /p password

Categories: ISeries (AS/400) Tags:

system i db2 functions for getting current date and weekday

July 2, 2012 Leave a comment

Get Current Date 

SELECT current date FROM sysibm.sysdummy1;

 

Get Current Day Name
SELECT DAYNAME(date(current_date)) FROM sysibm.sysdummy1;

 

Get Current Day of Week

SELECT DAYOFWEEK(date(current_date)) FROM sysibm.sysdummy1;

http://www.ibm.com/developerworks/data/library/techarticle/0211yip/0211yip3.html

Categories: ISeries (AS/400)

Create a table based on summary data DB2 i5/OS

March 12, 2012 Leave a comment

Syntax for creating a table based on query results from another table.

 

CREATE TABLE LIBRARY/SUMMARY AS
( SELECT CLASS, ITEM, SUM(NET)  AS NET_SALES
FROM LIBRARY/DETAIL GROUP BY CLASS, ITEM ) WITH DATA

Categories: ISeries (AS/400) Tags:

Backup files from a batch file and add a timestamp

January 11, 2012 Leave a comment

FOR %%V IN (FILENAME.XXX) DO FOR /F “tokens=1-6 delims=/: ” %%J IN (“%%~tV”) DO IF EXIST backups\%%L%%J%%K_%%M%%N%%O%%~xV (ECHO Cannot copy %%V) ELSE (COPY “%%V” backups\FILENAME_%%L%%J%%K_%%M%%N%%O%%~xV)

Categories: Windows