Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:odbc:examples:csharp_simple_select [2009/12/07 03:04]
tdo
— (current)
Line 1: Line 1:
-{{page>:​top_add&​nofooter&​noeditbtn}} 
-<​html><​div align="​center"><​span style="​color:​red">​DRAFT</​span></​div></​html>​ 
-^ [[dev:​odbc:​examples:​simpleselect | C++ ]] ^ C# ^ Java ^ PHP ^ 
-====== C# Omnidex ODBC Simple Select ====== 
  
-<code Csharp> 
-using System; 
-using System.Collections.Generic;​ 
-using System.Linq;​ 
-using System.Text;​ 
-using System.Data.Odbc;​ 
- 
-namespace OdxODBCSimpleSelect 
-{ 
-    class OdxODBCSimpleSelect 
-    { 
-        static void Main(string[] args) 
-        { 
-            Console.WriteLine("​C#​ OdxODBCSimpleSelect"​);​ 
-            // Have to use a USER DSN 
-            string connString = @"​dsn=OdxSystemTest1";​ 
-            string sqlselect = @"​select * from table1";​ 
-            OdbcConnection conn = null; 
-            OdbcDataReader reader = null; 
-            try 
-            { 
-                // Open Connection 
-                conn = new OdbcConnection(connString);​ 
-                conn.Open();​ 
-                // 
-                OdbcCommand cmd = new OdbcCommand(sqlselect,​ conn); 
-                reader = cmd.ExecuteReader();​ 
-                // Display output header 
-                Console.WriteLine("​MySeq\tMyText\n"​);​ 
-                // Process the result set 
-                while(reader.Read()) 
-                { 
-                    Console.WriteLine( 
-                        "{0} | {1}" 
-                        , reader["​MYSEQ"​].ToString().PadLeft(10) 
-                        , reader["​MYTEXT"​].ToString().PadLeft(10) 
-                    ); 
-                } 
-            } // try 
-            catch (Exception e) 
-            { 
-                Console.WriteLine("​Error:​ " + e); 
-            } 
-        } // end main 
-    } // end class 
-} // end namespace 
-</​code>​ 
-{{page>:​bottom_add&​nofooter&​noeditbtn}} 
 
Back to top
dev/odbc/examples/csharp_simple_select.1260155044.txt.gz ยท Last modified: 2012/10/26 14:52 (external edit)