Click here to Skip to main content
15,909,897 members
Home / Discussions / C#
   

C#

 
GeneralRe: Combobox large Data Pin
Ian Shlasko28-Feb-11 4:42
Ian Shlasko28-Feb-11 4:42 
GeneralRe: Combobox large Data Pin
sanforjackass28-Feb-11 4:52
sanforjackass28-Feb-11 4:52 
GeneralRe: Combobox large Data Pin
Ian Shlasko28-Feb-11 4:54
Ian Shlasko28-Feb-11 4:54 
GeneralRe: Combobox large Data Pin
Dave Kreskowiak28-Feb-11 8:55
mveDave Kreskowiak28-Feb-11 8:55 
GeneralRe: Combobox large Data Pin
darkelv1-Mar-11 22:23
darkelv1-Mar-11 22:23 
GeneralRe: Combobox large Data Pin
Pete O'Hanlon28-Feb-11 4:43
mvePete O'Hanlon28-Feb-11 4:43 
AnswerRe: Combobox large Data Pin
Eddy Vluggen28-Feb-11 4:29
professionalEddy Vluggen28-Feb-11 4:29 
Questionsqlite error in c# program Pin
avinash51028-Feb-11 3:39
avinash51028-Feb-11 3:39 
hello,

I have been working on an c# application which opens a sqlite file and delete a table in it...
but am getting an exception as follows...
please suggest me to handle that exception...



File opened that is not a database file
file is encrypted or is not a database


My code is

public String getAppdata()
        {
            return CurrentUsers.GetValue("AppData").ToString();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            CurrentUsers = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders");
            String path = getAppdata() + "\\Mozilla\\Firefox\\Profiles";
            foreach (String s in Directory.GetDirectories(path))
                path = s;
            //return path;
            DBManager dbm = new DBManager();
            dbm.Connect(path+ "\\places.sqlite");
            dbm.deleteTable("moz_historyvisits");
        }



my dbmanager class is


public void Connect(String DatabaseName)
        {
            db = new SQLiteConnection("Data Source=" + DatabaseName);
            db.Open();
        }
        public void deleteTable(String TableName)
        {
            cmd = new SQLiteCommand("", db);
            cmd.CommandText = "delete from " + TableName;
            cmd.ExecuteNonQuery();
        }       



am getting error at db.open() line in the above snippet....


Please suggest me to handle it....
Thanks in advance...

Smile | :) Smile | :)
Regards,
Avinash

AnswerRe: sqlite error in c# program Pin
loyal ginger28-Feb-11 3:54
loyal ginger28-Feb-11 3:54 
AnswerRe: sqlite error in c# program Pin
jschell28-Feb-11 8:23
jschell28-Feb-11 8:23 
QuestionHow to use progress bar according to the code execution timing. Pin
sr15928-Feb-11 2:08
sr15928-Feb-11 2:08 
AnswerRe: How to use progress bar according to the code execution timing. Pin
Ankur\m/28-Feb-11 2:20
professionalAnkur\m/28-Feb-11 2:20 
GeneralRe: How to use progress bar according to the code execution timing. Pin
Pete O'Hanlon28-Feb-11 2:30
mvePete O'Hanlon28-Feb-11 2:30 
GeneralRe: How to use progress bar according to the code execution timing. Pin
Ankur\m/28-Feb-11 2:53
professionalAnkur\m/28-Feb-11 2:53 
AnswerRe: How to use progress bar according to the code execution timing. Pin
coolestCoder28-Feb-11 2:21
coolestCoder28-Feb-11 2:21 
AnswerRe: How to use progress bar according to the code execution timing. Pin
Pete O'Hanlon28-Feb-11 2:26
mvePete O'Hanlon28-Feb-11 2:26 
GeneralRe: How to use progress bar according to the code execution timing. Pin
GenJerDan28-Feb-11 3:46
GenJerDan28-Feb-11 3:46 
GeneralRe: How to use progress bar according to the code execution timing. Pin
Pete O'Hanlon28-Feb-11 4:18
mvePete O'Hanlon28-Feb-11 4:18 
GeneralRe: How to use progress bar according to the code execution timing. Pin
GenJerDan28-Feb-11 4:25
GenJerDan28-Feb-11 4:25 
AnswerRe: How to use progress bar according to the code execution timing. Pin
Luc Pattyn28-Feb-11 2:27
sitebuilderLuc Pattyn28-Feb-11 2:27 
AnswerRe: How to use progress bar according to the code execution timing. Pin
_Erik_28-Feb-11 5:01
_Erik_28-Feb-11 5:01 
AnswerRe: How to use progress bar according to the code execution timing. Pin
RaviRanjanKr28-Feb-11 17:20
professionalRaviRanjanKr28-Feb-11 17:20 
QuestionStatic Method Pin
anishkannan28-Feb-11 1:06
anishkannan28-Feb-11 1:06 
AnswerRe: Static Method Pin
Keith Barrow28-Feb-11 1:32
professionalKeith Barrow28-Feb-11 1:32 
GeneralRe: Static Method Pin
anishkannan28-Feb-11 2:08
anishkannan28-Feb-11 2:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.