|
Makes sense when you think about it - I modified my response to correct it.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I Have a Large Data about 20000 Recored How Can I Load It Into Combobox Without Using For Loop Or Froeach Loop??????
EASY COME EASY GO
|
|
|
|
|
That large data you have in SQL Table or where else are stored?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
I know this isn't the answer you want, but, well...
sanforjackass wrote: I Have a Large Data about 20000 Recored How Can I Load It Into Combobox
Don't.
Seriously, no one wants to scroll through 20,000 records. Give them a search interface or something.
|
|
|
|
|
the problem is i want to load only names in it then when he type some words combobox will complete it and load the rest of the record so i need to load all names in combobox.items
(i used before foreach loop but it is too slaw)
EASY COME EASY GO
|
|
|
|
|
ANYTHING will be slow if you're adding 20,000 items to a GUI control.
Either build your own auto-complete Combobox, or find one on the web that does what you need. Either way, do NOT try to load 20,000 items into a GUI control.
Here's the first one that came up for me on CP: AutoComplete TextBox[^]
(Haven't tried this one out, but after a quick glance, it looks like it does what you need)
|
|
|
|
|
in access or sql server like this do really fast how can i do it
EASY COME EASY GO
|
|
|
|
|
I just told you how to do it...
|
|
|
|
|
You may not be looking for a ComboBox. See if a TextBox will work and look at it's AutoComplete properties.
|
|
|
|
|
|
Actually, you don't. Just because you need the names in memory doesn't mean that you need the names in the combo box. Have a quick google for autocomplete C# combobox to get some ideas on how to do this.
|
|
|
|
|
That's too much. Try adding that many strings and scroll through it, you'll have a hard time locating item #15863. Wouldn't it be easier to navigate if you had a ListBox , with a filter?
I are Troll
|
|
|
|
|
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;
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...
Regards,
Avinash
|
|
|
|
|
I suspect that the pathname offered was not correct. Can you put a break point on the db.Open() statement and check the value of DatabaseName? Copy the value and use a standlone utility to open the database to see if it is a good database.
|
|
|
|
|
Debug it by printing/logging/debugging the full value of 'DatabaseName' that is passed into the following.
Connect(String DatabaseName)
Also shouldn't the file have an extension on it?
|
|
|
|
|
I have created one windows application form, in that form loading i written code and for execution it will take 1 or 2 minutes (lenghty code). This i need to show in progress bar so that user can think process is going.
I used progress bar in that form in loading. The progress bar is not showing but code is executing.
How to use progress bar according to the code execution timing.
Please reply me. Thanks in advance.
|
|
|
|
|
You just had to type "Progress bar C#" into Google search box instead of typing so much here.
Check the search result - progress bar c#[^]
..Go Green..
|
|
|
|
|
Actually, it's a good job the user did. What they were displaying is a classic case of attempting to run multiple things on the UI thread. Had they just asked how to show the progress bar, they might not appreciate the difficulties in what they were trying to accomplish.
|
|
|
|
|
I am sorry I missed the main issue in the question.
I checked your and Luc's reply below.
How do I implement a progress bar in C#?[^] - this is from the very first page of the search link and if I understood your answer correctly, this is what you were talking about below.
All I meant to say that the OP should have done a little research before asking.
..Go Green..
|
|
|
|
|
Please use this[^] class. You will find many example when you Google for it.
Found my answer helpful? Then vote for it. "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
In all probability, you are loading the form and displaying the progress bar using the UI thread. What you need to do is separate out the logic that takes a long time to run into a background thread, and periodically refresh/pulse the progress bar. I would argue though, that you have a poor user design if they have to wait 2 minutes for a form to load. I'd drop kick any developer who released code like that for me.
|
|
|
|
|
I take it you've never run Calibre[^]. Takes forever to load. Have no idea what it's doing, other than not starting promptly.
|
|
|
|
|
GenJerDan wrote: Have no idea what it's doing
Thread.Sleep(30000000);
|
|
|
|
|
Ah! A function call designed to dissuade all who are not seriously committed.
|
|
|
|