You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/connect/odbc/index.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,14 +47,14 @@ OdbcConnection connection = new OdbcConnection(connection_string);
47
47
connection.Open();
48
48
49
49
// Invoke query
50
-
OdbcCommandcommand=newOdbcCommand("SELECT mountain, height FROM sys.summits ORDER BY height DESC LIMIT 5");
50
+
OdbcCommandcommand=newOdbcCommand("SELECT mountain, height FROM sys.summits ORDER BY height DESC LIMIT 5", connection);
51
51
OdbcDataReaderreader=command.ExecuteReader();
52
52
53
53
// Display results
54
-
while(reader.Read())
54
+
while(reader.Read())
55
55
{
56
-
Stringmountain=reader.GetString(0);
57
-
Integerheight=reader.GetString(1);
56
+
Stringmountain=reader.GetString(0);
57
+
intheight=reader.GetInt32(1);
58
58
Console.Write(mountain+": "+height);
59
59
Console.WriteLine();
60
60
}
@@ -188,7 +188,7 @@ cn.Close
188
188
189
189
190
190
[.NET Framework Data Provider for ODBC]: https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/data-providers#net-framework-data-provider-for-odbc
191
-
[Connecting to PostgreSQL with pyodbc]: https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-PostgreSQL
191
+
[connecting to PostgreSQL with pyodbc]: https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-PostgreSQL
0 commit comments