Show / Hide Table of Contents

Class PrepQueryWithRef

PrepQueryWithRef is the class that creates advanced database phrases with references.
Use of a sample;
String[] insertQuery = PrepareQuery.setInsert(tableName, fieldNames, formData, fieldTypes, refFieldMatchs, refData, dateFormatter);

Inheritance
System.Object
PrepareQuery
PrepQueryWithRef
Inherited Members
PrepareQuery.STRING
PrepareQuery.INTEGER
PrepareQuery.DATE
PrepareQuery.NUMBER
PrepareQuery.EQ
PrepareQuery.SM
PrepareQuery.BG
PrepareQuery.SME
PrepareQuery.BGE
PrepareQuery.NEQ
PrepareQuery.LK
PrepareQuery.equalityStr
PrepareQuery.queryString
PrepareQuery.errorString
PrepareQuery.queryStr
PrepareQuery.isLocale
PrepareQuery.convert2EQLs(Int32[])
PrepareQuery.setSelect(String, String[], String[], Int32[], String, DateFormatter, String[])
PrepareQuery.setInsert(String, String[], String[], Int32[], DateFormatter)
PrepareQuery.setUpdate(String, String[], String[], Int32[], DateFormatter)
PrepareQuery.setDelete(String, String, String)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SDBCS.dbwork
Assembly: SDBCS.dll
Syntax
public class PrepQueryWithRef : PrepareQuery
Remarks

Author Mehmet Hayati KINAŞ

Version 1.0

Methods

setInsert(String, String[], String[], Int32[], Int32[], String[], DateFormatter)

Creates a sql insert sentence and returns it.

Declaration
public string[] setInsert(string tableName, string[] fieldNames, string[] formData, int[] fieldTypes, int[] refFieldMatchs, string[] refData, DateFormatter dateFormatter)
Parameters
Type Name Description
System.String tableName

The table name to be accessed.

System.String[] fieldNames

Names of fields of the table to access.

System.String[] formData

An array of data from the HTML form to be used in the SQL statement.

System.Int32[] fieldTypes

The data types of the fields of the table to access.

System.Int32[] refFieldMatchs

Sequence of the reference fields to be accessed.

System.String[] refData

A set of reference data from the reference table to be used in the SQL statement.

DateFormatter dateFormatter

DateFormatter instance for formatting for dates.

Returns
Type Description
System.String[]

Returns a new recordset sequence in the String[] format.

setKeyField(String)

If you want key field name different from id, you can set it. I must be same at other reference tables. Or ....

Declaration
public void setKeyField(string keyField)
Parameters
Type Name Description
System.String keyField

The key field name of the table to access.

setKeyFields(String[])

If you want key field names different each other, you can set them.

Declaration
public void setKeyFields(string[] keyFields)
Parameters
Type Name Description
System.String[] keyFields

Key field names of the table to access.

setRefSelect(Int32[], String[], String[], String[], Int32[])

Creates and returns the database query statement for the reference table.

Declaration
public string[] setRefSelect(int[] fieldTypes, string[] formData, string[] refTableNames, string[] refFieldNames, int[] refFieldMatchs)
Parameters
Type Name Description
System.Int32[] fieldTypes

The data types of the fields of the table to access.

System.String[] formData

An array of data from the HTML form to be used in the SQL statement.

System.String[] refTableNames

The desired reference table name to be accessed.

System.String[] refFieldNames

The string of names of the fields of reference tables to be accessed.

System.Int32[] refFieldMatchs

Sequence of the reference fields to be accessed.

Returns
Type Description
System.String[]

Returns an array of query statements.

setUpdate(String, String[], String[], Int32[], Int32[], String[], DateFormatter)

Creates and returns a database update statement.

Declaration
public string[] setUpdate(string tableName, string[] fieldNames, string[] formData, int[] fieldTypes, int[] refFieldMatchs, string[] refData, DateFormatter dateFormatter)
Parameters
Type Name Description
System.String tableName

The table name to be accessed.

System.String[] fieldNames

Names of fields of the table to access.

System.String[] formData

An array of data from the HTML form to be used in the SQL statement.

System.Int32[] fieldTypes

The data types of the fields of the table to access.

System.Int32[] refFieldMatchs

Sequence of the reference fields to be accessed.

System.String[] refData

A set of reference data from the reference table to be used in the SQL statement.

DateFormatter dateFormatter

DateFormatter instance for formatting for dates.

Returns
Type Description
System.String[]

Returns an String array of substitution statements.

In This Article
Back to top Generated by DocFX