Register   |  Login

Search_Blog

Minimize
May 12

Written by: Robert Houben, CTO
5/12/2010 11:46 AM  RssIcon

Controlling Which Records to Retreive

In the following exercise, we will change the application so that you can enter a filter value on a "name starting with" value and click a button to return oly users with a name that starts with the filtering value.

Customizing the mvCust Class

New Accessor Method

First, add the following new method to the mvCust class:

 

[DataObjectMethod(DataObjectMethodType.Select, false)]
public static DataTable getCustWithNameStarting(string startString)
{
    DataSet ds = null;
    List<mvCust> list = new List<mvCust>();
    DbConnection connection = null;
    DbCommand command = null;
    DbDataAdapter adapter = null;
    DataTable dt = null;
    DbParameter startsWithParam = null;
    try
    {
        using (connection = getConnection())
        {
            connection.Open();
            using (command = m_factory.CreateCommand())
            {
                command.Connection = connection;
                // Our provider will substitute the parameter with surrounding double
                // quotes (because it is contained in single quotes).
                command.CommandText = "CUST 'SELECT CUST WITH CUST.NAME = @CUSTNAME'";
                startsWithParam = m_factory.CreateParameter();
                startsWithParam.ParameterName = "@CUSTNAME";
                // The trailing ']' is PICK-speak for "followed by anything"
                startsWithParam.Value = startString + "]";
                command.Parameters.Add(startsWithParam);
                using (adapter = m_factory.CreateDataAdapter())
                {
                    adapter.SelectCommand = command;
                    ds = new DataSet("CUST");
                    adapter.Fill(ds, "CUST");
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        dt = ds.Tables["CUST"];
                    }
                }
            }
        }
    }
    catch (Exception ex)
    {
        System.Console.WriteLine(ex.ToString());
    }
    return dt;
}

FusionWare Direct Product Family

The FusionWare Direct product family includes client providers that enable access to your MultiValue data from Java, .NET and Legacy COM/COM+ environments.

Client Platforms Supported

Client Platforms supported for .NET and COM clients include:

  • Windows 2000, 2003 and 2008, 32 bit and 64 bit
  • Windows XP, Vista and Windows 7, 32 bit and 64 bit

Client Platforms Supported for Java client include:

  • Windows 2000, 2003 and 2008, 32 bit and 64 bit
  • Windows XP, Vista and Windows 7, 32 bit and 64 bit
  • IBM Platforms:
    • IBM i (AS/400)
    • System z (mainframe)
    • System p (AIX)
    • Certified "Ready for IBM Systems with Linux"
  • Linux
  • Unix
  • and more...

MultiValue Platforms Supported

  • Rocket (formerly IBM)
    • U2 (Universe and Unidata) including Universe back to version 5
    • PI Open
  • Raining Data
    • D3
    • mvEnterprise
    • mvBase
  • Northgate
    • Reality
    • Reality/X
  • Temenos Group
    • jBase
  • Ladybridge Systems (coming soon)
    • QM
    • Open QM
  • Others (older or unsupported MultiValue Systems
    • UltPlus
    • Power95
    • and more...

Copyright ©2010 FusionWare Integration Corporation

Tags: ADO.NET , MultiValue , WPF
Categories:
Location: Blogs Parent Separator CTO Blog

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
You must be logged in and have permission to create or edit a blog.