Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlServerCe;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Connection2SQLCompactEditionConsole
- {
- class Program
- {
- static void Main(string[] args)
- {
- // SqlCeConnection
- SqlCeConnection connection =
- new SqlCeConnection(@"Data Source=c:\users\stoyan\documents\visual studio 2012\Projects\Connection2SQLCompactEditionWinForms\Connection2SQLCompactEditionWinForms\StoyanMS_SQL_CE.sdf;Password=password;Persist Security Info=True");
- SqlCeCommand command = new SqlCeCommand("SELECT * FROM users", connection);
- SqlCeDataAdapter dataAdapter = new SqlCeDataAdapter(command);
- DataSet ds = new DataSet();
- dataAdapter.Fill(ds);
- Console.WriteLine("Done");
- // while (aReader.Read())
- // {
- // Console.WriteLine(aReader.GetInt32(0).ToString());
- // }
- // SqlCeDataReader aReader = command.ExecuteReader();
- // while (aReader.Read())
- // {
- // Console.WriteLine(aReader.GetInt32(0).ToString());
- // }
- // dataAdapter.
- // Visualize DataSet.
- Console.WriteLine(ds.GetXml());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement