|
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.
|
|
|
|
|
If you want a snappy GUI and/or you want to show some progress, you should limit the execution time of each of your GUI event handlers to say less than 30 msec. So having lengthy operations in a Form Load handler is no good; you should instead:
- launch a thread (possibly a BackgroundWorker ) in the Form Load handler;
- have that thread perform the lengthy operation (e.g. database access) and store results in some data structure;
- then use Invoke to have the GUI thread update the GUI, showing the newly acquired data, and probably enabling the Controls that now should be functional.
When the operation that needs to show progress is indivisible, you can't really show progress, all you can indicate is that time is progressing, so you should estimate a worst-case time span, and show a progress bar that advances at periodic points in time. A System.Windows.Forms.Timer is excellent for such purpose.
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.
|
|
|
|
|
Look at this[^]. Yes, I wrote it...
|
|
|
|
|
hi sr159
Sometimes there's no practicable way to measure progress towards completion, using a simple mathematical formula.
In such cases, you need to estimate in advance how long the operation will take and then change the ProgressBar in accordance with the percentage time elapsed since inception. You also need to avoid moving the progress bar up to 100% until the overall task has completed.
take a look there[^]
|
|
|
|