Re: [sqlite] How to create a Datatable [first steps of newbie]
This is the connection string connString = String.Format("Data Source={0};New=False;Version=3", Properties.Settings.Default.DB_Path); and as I told you it works elsewhere in the program so the problem must be another one. Roosevelt Anderson ha scritto: > http://sqlite.phxsoftware.com/forums/p/532/532.aspx > > On Sun, Jan 11, 2009 at 12:18 PM, Alessio Forconiwrote: > >> It means that the connection that I use in the code that I showed you is >> the same as that used in other parts of the program, only that we do not >> work, I get that bug that I told you. >> >> Thanks for your availability. >> >> Roosevelt Anderson ha scritto: >> >>> What does your connection string look like? >>> >>> On Fri, Jan 9, 2009 at 2:36 PM, Alessio Forconi wrote: >>> >>> Thanks for your suggestion, I do not think that is the problem because the connection is the one used with success in other parts of the program, you show the code that I wrote following your suggestions: string sqlString = "SELECT * FROM Proclamatori"; conn = new SQLiteConnection(connString); try { conn.Open(); SQLiteDataAdapter apt = new SQLiteDataAdapter(sqlString, conn); DataTable dtProclamatori = new DataTable(); apt.Fill(dtProclamatori); } catch (SQLiteException ex) { MessageBox.Show(ex.Message); } finally { conn.Close(); } I know that there are groups for microsoft c # but that does not seem like a software applications that are not microsoft: ( Roosevelt Anderson ha scritto: > It should be "Data Source=database.db" not "DataSource=database.db". I > didn't realize this because of the line break in the email. This will > create a new, empty database named database.db in the directory where > your application is running. > > On Fri, Jan 9, 2009 at 7:32 AM, Alessio Forconi > wrote: > > > >> Thanks... >> >> I get this error >> >> "Data Source cannot be empty. Use :memory: to open an in-memory database" >> >> but the connection is sattamante the same as that used in other parts of >> the program >> >> Roosevelt Anderson ha scritto: >> >> >> >>> If you trying to extract data from a sqlite database to a DataTable >>> here is how you do it using the .Net data provider: >>> >>>SQLiteConnection conn = new SQLiteConnection("Data >>> Source=database.db"); >>> conn.Open(); >>> SQLiteDataAdapter apt = new SQLiteDataAdapter("select * from >>> tbl", conn); >>> DataTable dt = new DataTable(); >>> apt.Fill(dt); >>> conn.Close(); >>> >>> >>> >>> >>> On Thu, Jan 8, 2009 at 11:28 AM, Alessio Forconi >>> wrote: >>> >>> >>> >>> Hello everyone, I am making the first steps with the programming and I want to help create a DataTable from a database sqlite with C #. Can you give me an example of how do I create it without using a dataset? Thank you very much for your help. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> ___ >>> sqlite-users mailing list >>> sqlite-users@sqlite.org >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> >>> >>> >>> >>> >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> >> >> > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> ___ >>> sqlite-users mailing list >>> sqlite-users@sqlite.org >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> >>> >>> >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > ___ > sqlite-users mailing
Re: [sqlite] How to create a Datatable [first steps of newbie]
http://sqlite.phxsoftware.com/forums/p/532/532.aspx On Sun, Jan 11, 2009 at 12:18 PM, Alessio Forconiwrote: > It means that the connection that I use in the code that I showed you is > the same as that used in other parts of the program, only that we do not > work, I get that bug that I told you. > > Thanks for your availability. > > Roosevelt Anderson ha scritto: >> What does your connection string look like? >> >> On Fri, Jan 9, 2009 at 2:36 PM, Alessio Forconi wrote: >> >>> Thanks for your suggestion, I do not think that is the problem because >>> the connection is the one used with success in other parts of the >>> program, you show the code that I wrote following your suggestions: >>> >>> string sqlString = "SELECT * FROM Proclamatori"; >>> conn = new SQLiteConnection(connString); >>> try >>> { >>> conn.Open(); >>> SQLiteDataAdapter apt = new SQLiteDataAdapter(sqlString, conn); >>> DataTable dtProclamatori = new DataTable(); >>> apt.Fill(dtProclamatori); >>> } >>> catch (SQLiteException ex) >>> { >>> MessageBox.Show(ex.Message); >>> } >>> finally >>> { >>> conn.Close(); >>> } >>> >>> >>> I know that there are groups for microsoft c # but that does not seem >>> like a software applications that are not microsoft: ( >>> >>> Roosevelt Anderson ha scritto: >>> It should be "Data Source=database.db" not "DataSource=database.db". I didn't realize this because of the line break in the email. This will create a new, empty database named database.db in the directory where your application is running. On Fri, Jan 9, 2009 at 7:32 AM, Alessio Forconi wrote: > Thanks... > > I get this error > > "Data Source cannot be empty. Use :memory: to open an in-memory database" > > but the connection is sattamante the same as that used in other parts of > the program > > Roosevelt Anderson ha scritto: > > >> If you trying to extract data from a sqlite database to a DataTable >> here is how you do it using the .Net data provider: >> >>SQLiteConnection conn = new SQLiteConnection("Data >> Source=database.db"); >> conn.Open(); >> SQLiteDataAdapter apt = new SQLiteDataAdapter("select * from >> tbl", conn); >> DataTable dt = new DataTable(); >> apt.Fill(dt); >> conn.Close(); >> >> >> >> >> On Thu, Jan 8, 2009 at 11:28 AM, Alessio Forconi >> wrote: >> >> >> >>> Hello everyone, >>> >>> I am making the first steps with the programming and I want to help >>> create a DataTable from a database sqlite with C #. >>> >>> Can you give me an example of how do I create it without using a >>> dataset? >>> >>> Thank you very much for your help. >>> ___ >>> sqlite-users mailing list >>> sqlite-users@sqlite.org >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> >>> >>> >>> >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> >> >> > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> ___ >>> sqlite-users mailing list >>> sqlite-users@sqlite.org >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> >>> >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How to create a Datatable [first steps of newbie]
It means that the connection that I use in the code that I showed you is the same as that used in other parts of the program, only that we do not work, I get that bug that I told you. Thanks for your availability. Roosevelt Anderson ha scritto: > What does your connection string look like? > > On Fri, Jan 9, 2009 at 2:36 PM, Alessio Forconiwrote: > >> Thanks for your suggestion, I do not think that is the problem because >> the connection is the one used with success in other parts of the >> program, you show the code that I wrote following your suggestions: >> >> string sqlString = "SELECT * FROM Proclamatori"; >> conn = new SQLiteConnection(connString); >> try >> { >> conn.Open(); >> SQLiteDataAdapter apt = new SQLiteDataAdapter(sqlString, conn); >> DataTable dtProclamatori = new DataTable(); >> apt.Fill(dtProclamatori); >> } >> catch (SQLiteException ex) >> { >> MessageBox.Show(ex.Message); >> } >> finally >> { >> conn.Close(); >> } >> >> >> I know that there are groups for microsoft c # but that does not seem >> like a software applications that are not microsoft: ( >> >> Roosevelt Anderson ha scritto: >> >>> It should be "Data Source=database.db" not "DataSource=database.db". I >>> didn't realize this because of the line break in the email. This will >>> create a new, empty database named database.db in the directory where >>> your application is running. >>> >>> On Fri, Jan 9, 2009 at 7:32 AM, Alessio Forconi wrote: >>> >>> Thanks... I get this error "Data Source cannot be empty. Use :memory: to open an in-memory database" but the connection is sattamante the same as that used in other parts of the program Roosevelt Anderson ha scritto: > If you trying to extract data from a sqlite database to a DataTable > here is how you do it using the .Net data provider: > >SQLiteConnection conn = new SQLiteConnection("Data > Source=database.db"); > conn.Open(); > SQLiteDataAdapter apt = new SQLiteDataAdapter("select * from > tbl", conn); > DataTable dt = new DataTable(); > apt.Fill(dt); > conn.Close(); > > > > > On Thu, Jan 8, 2009 at 11:28 AM, Alessio Forconi > wrote: > > > >> Hello everyone, >> >> I am making the first steps with the programming and I want to help >> create a DataTable from a database sqlite with C #. >> >> Can you give me an example of how do I create it without using a >> dataset? >> >> Thank you very much for your help. >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> >> >> > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> ___ >>> sqlite-users mailing list >>> sqlite-users@sqlite.org >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> >>> >>> >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How to create a Datatable [first steps of newbie]
What does your connection string look like? On Fri, Jan 9, 2009 at 2:36 PM, Alessio Forconiwrote: > Thanks for your suggestion, I do not think that is the problem because > the connection is the one used with success in other parts of the > program, you show the code that I wrote following your suggestions: > > string sqlString = "SELECT * FROM Proclamatori"; > conn = new SQLiteConnection(connString); > try > { > conn.Open(); > SQLiteDataAdapter apt = new SQLiteDataAdapter(sqlString, conn); > DataTable dtProclamatori = new DataTable(); > apt.Fill(dtProclamatori); > } > catch (SQLiteException ex) > { > MessageBox.Show(ex.Message); > } > finally > { > conn.Close(); > } > > > I know that there are groups for microsoft c # but that does not seem > like a software applications that are not microsoft: ( > > Roosevelt Anderson ha scritto: >> It should be "Data Source=database.db" not "DataSource=database.db". I >> didn't realize this because of the line break in the email. This will >> create a new, empty database named database.db in the directory where >> your application is running. >> >> On Fri, Jan 9, 2009 at 7:32 AM, Alessio Forconi wrote: >> >>> Thanks... >>> >>> I get this error >>> >>> "Data Source cannot be empty. Use :memory: to open an in-memory database" >>> >>> but the connection is sattamante the same as that used in other parts of >>> the program >>> >>> Roosevelt Anderson ha scritto: >>> If you trying to extract data from a sqlite database to a DataTable here is how you do it using the .Net data provider: SQLiteConnection conn = new SQLiteConnection("Data Source=database.db"); conn.Open(); SQLiteDataAdapter apt = new SQLiteDataAdapter("select * from tbl", conn); DataTable dt = new DataTable(); apt.Fill(dt); conn.Close(); On Thu, Jan 8, 2009 at 11:28 AM, Alessio Forconi wrote: > Hello everyone, > > I am making the first steps with the programming and I want to help > create a DataTable from a database sqlite with C #. > > Can you give me an example of how do I create it without using a > dataset? > > Thank you very much for your help. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> ___ >>> sqlite-users mailing list >>> sqlite-users@sqlite.org >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> >>> >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How to create a Datatable [first steps of newbie]
Thanks for your suggestion, I do not think that is the problem because the connection is the one used with success in other parts of the program, you show the code that I wrote following your suggestions: string sqlString = "SELECT * FROM Proclamatori"; conn = new SQLiteConnection(connString); try { conn.Open(); SQLiteDataAdapter apt = new SQLiteDataAdapter(sqlString, conn); DataTable dtProclamatori = new DataTable(); apt.Fill(dtProclamatori); } catch (SQLiteException ex) { MessageBox.Show(ex.Message); } finally { conn.Close(); } I know that there are groups for microsoft c # but that does not seem like a software applications that are not microsoft: ( Roosevelt Anderson ha scritto: > It should be "Data Source=database.db" not "DataSource=database.db". I > didn't realize this because of the line break in the email. This will > create a new, empty database named database.db in the directory where > your application is running. > > On Fri, Jan 9, 2009 at 7:32 AM, Alessio Forconiwrote: > >> Thanks... >> >> I get this error >> >> "Data Source cannot be empty. Use :memory: to open an in-memory database" >> >> but the connection is sattamante the same as that used in other parts of >> the program >> >> Roosevelt Anderson ha scritto: >> >>> If you trying to extract data from a sqlite database to a DataTable >>> here is how you do it using the .Net data provider: >>> >>>SQLiteConnection conn = new SQLiteConnection("Data >>> Source=database.db"); >>> conn.Open(); >>> SQLiteDataAdapter apt = new SQLiteDataAdapter("select * from >>> tbl", conn); >>> DataTable dt = new DataTable(); >>> apt.Fill(dt); >>> conn.Close(); >>> >>> >>> >>> >>> On Thu, Jan 8, 2009 at 11:28 AM, Alessio Forconi wrote: >>> >>> Hello everyone, I am making the first steps with the programming and I want to help create a DataTable from a database sqlite with C #. Can you give me an example of how do I create it without using a dataset? Thank you very much for your help. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> ___ >>> sqlite-users mailing list >>> sqlite-users@sqlite.org >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> >>> >>> >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How to create a Datatable [first steps of newbie]
It should be "Data Source=database.db" not "DataSource=database.db". I didn't realize this because of the line break in the email. This will create a new, empty database named database.db in the directory where your application is running. On Fri, Jan 9, 2009 at 7:32 AM, Alessio Forconiwrote: > Thanks... > > I get this error > > "Data Source cannot be empty. Use :memory: to open an in-memory database" > > but the connection is sattamante the same as that used in other parts of > the program > > Roosevelt Anderson ha scritto: >> If you trying to extract data from a sqlite database to a DataTable >> here is how you do it using the .Net data provider: >> >>SQLiteConnection conn = new SQLiteConnection("Data >> Source=database.db"); >> conn.Open(); >> SQLiteDataAdapter apt = new SQLiteDataAdapter("select * from tbl", >> conn); >> DataTable dt = new DataTable(); >> apt.Fill(dt); >> conn.Close(); >> >> >> >> >> On Thu, Jan 8, 2009 at 11:28 AM, Alessio Forconi wrote: >> >>> Hello everyone, >>> >>> I am making the first steps with the programming and I want to help >>> create a DataTable from a database sqlite with C #. >>> >>> Can you give me an example of how do I create it without using a >>> dataset? >>> >>> Thank you very much for your help. >>> ___ >>> sqlite-users mailing list >>> sqlite-users@sqlite.org >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >>> >>> >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How to create a Datatable [first steps of newbie]
Thanks... I get this error "Data Source cannot be empty. Use :memory: to open an in-memory database" but the connection is sattamante the same as that used in other parts of the program Roosevelt Anderson ha scritto: > If you trying to extract data from a sqlite database to a DataTable > here is how you do it using the .Net data provider: > >SQLiteConnection conn = new SQLiteConnection("Data > Source=database.db"); > conn.Open(); > SQLiteDataAdapter apt = new SQLiteDataAdapter("select * from tbl", > conn); > DataTable dt = new DataTable(); > apt.Fill(dt); > conn.Close(); > > > > > On Thu, Jan 8, 2009 at 11:28 AM, Alessio Forconiwrote: > >> Hello everyone, >> >> I am making the first steps with the programming and I want to help >> create a DataTable from a database sqlite with C #. >> >> Can you give me an example of how do I create it without using a >> dataset? >> >> Thank you very much for your help. >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How to create a Datatable [first steps of newbie]
Alessio Forconi wrote: > > Hello everyone, > > I am making the first steps with the programming and I want to help > create a DataTable from a database sqlite with C #. > Can you give me an example of how do I create it without using a > dataset? > Thank you very much for your help. > Just in case you are not aware of MS newsgroups http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.languages.csharp/2004-10/ microsoft.public.dotnet.languages.csharp -- View this message in context: http://www.nabble.com/How-to-create-a-Datatable--first-steps-of-newbie--tp21355219p21363197.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How to create a Datatable [first steps of newbie]
If you trying to extract data from a sqlite database to a DataTable here is how you do it using the .Net data provider: SQLiteConnection conn = new SQLiteConnection("Data Source=database.db"); conn.Open(); SQLiteDataAdapter apt = new SQLiteDataAdapter("select * from tbl", conn); DataTable dt = new DataTable(); apt.Fill(dt); conn.Close(); On Thu, Jan 8, 2009 at 11:28 AM, Alessio Forconiwrote: > Hello everyone, > > I am making the first steps with the programming and I want to help > create a DataTable from a database sqlite with C #. > > Can you give me an example of how do I create it without using a > dataset? > > Thank you very much for your help. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users