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 Forconi <forco...@gmail.com> wrote: > >> 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 <forco...@gmail.com> 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 <forco...@gmail.com> >>>>> 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 <forco...@gmail.com> >>>>>>> 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 > > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users