Skip to content
Browse files

Added basic lookup of sqlite database and data sources

  • Loading branch information...
1 parent 52fefa9 commit faeb7210da229ed608fd5885b7e3c8ec0dc986cd @codev2 codev2 committed Dec 3, 2012
View
3 .gitignore
@@ -1,4 +1,5 @@
[Oo]bj
[Bb]in
_Resharper.*
-*.suo
+*.suo
+*.user
View
21 Console/Console.csproj
@@ -40,6 +40,12 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
+ <Reference Include="System.Data.SQLite">
+ <HintPath>..\lib\sqlite\System.Data.SQLite.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Data.SQLite.Linq">
+ <HintPath>..\lib\sqlite\System.Data.SQLite.Linq.dll</HintPath>
+ </Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -50,6 +56,21 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="db\database.sqlite">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="..\lib\sqlite\SQLite.Interop.dll">
+ <Link>SQLite.Interop.dll</Link>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\lib\sqlite\SQLite.Interop.pdb">
+ <Link>SQLite.Interop.pdb</Link>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
6 Console/Console.csproj.user
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectView>ShowAllFiles</ProjectView>
+ </PropertyGroup>
+</Project>
View
22 Console/Program.cs
@@ -1,14 +1,28 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System.Data.SQLite;
namespace Console
{
class Program
{
static void Main(string[] args)
{
+ const string connString = "Data Source=db\\database.sqlite";
+
+ using (var conn = new SQLiteConnection(connString))
+ {
+ using (var cmd = new SQLiteCommand("SELECT * FROM CUSTOMER", conn))
+ {
+ conn.Open();
+
+ using (var dr = cmd.ExecuteReader())
+ {
+ while (dr.Read())
+ {
+ System.Console.WriteLine(dr.GetValue(0) + " " + dr.GetValue(1));
+ }
+ }
+ }
+ }
}
}
}
View
BIN lib/sqlite/SQLite.Interop.dll
Binary file not shown.
View
BIN lib/sqlite/SQLite.Interop.pdb
Binary file not shown.
View
BIN lib/sqlite/System.Data.SQLite.Linq.dll
Binary file not shown.
View
BIN lib/sqlite/System.Data.SQLite.Linq.pdb
Binary file not shown.
View
1,981 lib/sqlite/System.Data.SQLite.Linq.xml
1,981 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
BIN lib/sqlite/System.Data.SQLite.dll
Binary file not shown.
View
BIN lib/sqlite/System.Data.SQLite.pdb
Binary file not shown.
View
4,924 lib/sqlite/System.Data.SQLite.xml
4,924 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

0 comments on commit faeb721

Please sign in to comment.
Something went wrong with that request. Please try again.