-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCubeSQLTestApp.cs
More file actions
executable file
·59 lines (50 loc) · 2.19 KB
/
CubeSQLTestApp.cs
File metadata and controls
executable file
·59 lines (50 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// ___ __ ____ ____ _ __
// / | ____ ____/ /_______ ____ ______ / __ \/ __/__ (_) /
// / /| | / __ \/ __ / ___/ _ \/ __ `/ ___/ / /_/ / /_/ _ \/ / /
// / ___ |/ / / / /_/ / / / __/ /_/ (__ ) / ____/ __/ __/ / /
// /_/ |_/_/ /_/\__,_/_/ \___/\__,_/____/ /_/ /_/ \___/_/_/
//
// Product: cubeSQL.NET - Demo App for the C-SDK .NET wrapper
// Version: Revision: 1.0.0, Build: 1
// Date: 2021/06/03 21:58:48
// Author: Andreas Pfeil <patreon@familie-pfeil.com>
//
// Description: Opens a cubeSQL database connection with the help of the
// Marco Bambini's native C-SDK driver, selects a database
// and selects some rows. Outputs info and the rows.
//
// License: BEER license / MIT license
//
// Copyright (C) 2021 by Andreas Pfeil
//
// -----------------------------------------------------------------------TAB=2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CubeSQLTestApp {
using CubeSQL;
class CubeSQLTestApp {
static void Main( string[] args ) {
CubeSQL c = new CubeSQL( "localhost", "logingname", "password" );
Console.WriteLine( "Version = " + c.version() );
c.use( "webuy.coupons" );
CubeSQLResult result = c.select( "SELECT * FROM Feedback" );
Console.WriteLine( "ErrorCode = " + c.getErrorCode() );
Console.WriteLine( "ErrorMessage = " + c.getErrorMessage() );
Console.WriteLine( "Rows = " + result.getNumRows() );
Console.WriteLine( "Columns = " + result.getNumCols() );
Console.WriteLine( "Current Row = " + result.getCurrentRow() );
while( result.hasMoreRows() ) {
foreach( string columnName in result.columnNames )
Console.WriteLine( String.Format( "Spalte {0} = {1}", columnName, result[ columnName ] ) );
for( int I = result.getNumCols(), i = 1; i <= I; i++ ) {
Console.Write( "Spalte " + i + " (" + result.getColumnName( i ) + "): " );
Console.WriteLine( result.getStringValue( i ) );
}
result.next();
}
}
}
}