For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I have the busiest WPF form I have ever created, 23 combo boxes, 35 text boxes or date pickers and a bunch of buttons and that is just the first tab, there are 10 other tabs with lists and user controls. All user controls are lazy loaded when the tab is selected.
There is a load of automation on the form where 1 action filters/disables 1 or more controls.
I load the data using a BGW thread and that is fast and consistent. The data is loaded into a local object and when the loading is complete I bind the selected object
SelectedObject = LocalObject
The binding is initially resonably fast, sub 1 second, this blows out to 8+ seconds with subsequent page loads. The delay seems to be caused by binding the SelectedObject to the LocalObject (the delay is so huge it can easily be tracked to that line of code).
Any suggestions how I can alleviate the delay problem when binding.
Never underestimate the power of human stupidity
I feel quite defeated and overwhelmed at present. Apologies if this is done incorrectly. Any assistance would be warmly welcomed.
I'm writing a program in WPF, using c#, which should collect inputs via relevant textbox fields. These inputs should filter through to my sql command parameters, where I can then run the stored procedure. Then the info should populate back into a Datagrid in WPF mainwindow.
Basically, searching through historical stock pricing, returning all info between date, price, volume, etc, based on whichever values the user selects.
My SQL stored procedure returns expected values. The only way I can get my program to return the same values is to hardcode each input. I know I am missing the link between getting the values from each textbox into the SQL command parameters, but I'm at a loss as to how to do this. I think I need to set an event in my "mainwindow.xaml.cs" but I just cannot work out the right syntax...
You'll need to modify your MSQ method to accept the parameters. It looks like your StockValues class is intended to hold the parameter values.
publicstatic DataTable MSQ(StockValues sv)
using (SqlConnection conn = Database.GetSqlConnection())
using (SqlCommand cmd = new SqlCommand("SELECT date, stock_symbol, stock_price_open, stock_price_close, stock_price_lo, stock_price_high, stock_price_adj_close, stock_volume FROM NYSE WHERE date BETWEEN @date_from AND @date_to AND stock_symbol LIKE @stock_symbol AND stock_price_open BETWEEN @stock_price_open_from AND @stock_price_open_to AND stock_price_close BETWEEN @stock_price_close_from AND @stock_price_adj_close_to AND stock_price_lo BETWEEN @stock_price_lo_from AND @stock_price_lo_to AND stock_price_high BETWEEN @stock_price_high_from AND @stock_price_high_to AND stock_price_adj_close BETWEEN @stock_price_adj_close_from AND @stock_price_adj_close_to AND stock_volume BETWEEN @stock_volume_from AND @stock_volume_to", conn))
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable table = new DataTable();
In your buttonFind_Click method, you'll need to create an instance of the StockValues class, populate it from the textbox values, and then pass it to the MSQ method.
privatevoid buttonFind_Click(object sender, RoutedEventArgs e)
StockValues sv = new StockValues
stock_symbol = textBoxStockSymbol.Text
if (DateTime.TryParse(textBoxDateFrom.Text, out date))
sv.sv.date_from = date;
if (DateTime.TryParse(textBoxDateTo.Text, out date))
sv.date_to = date;
if (float.TryParse(textBoxSPOpenFrom.Text, out valueFloat))
sv.stock_price_open_from = valueFloat;
if (float.TryParse(textBoxSPOpenTo.Text, out valueFloat))
sv.stock_price_open_to = valueFloat;
if (float.TryParse(textBoxSPCloseFrom.Text, out valueFloat))
sv.stock_price_close_from = valueFloat;
if (float.TryParse(textBoxSPCloseTo.Text, out valueFloat))
sv.stock_price_close_to = valueFloat;
if (float.TryParse(textBoxSPLowFrom.Text, out valueFloat))
sv.stock_price_lo_from = valueFloat;
if (float.TryParse(textBoxSPLowTo.Text, out valueFloat))
sv.stock_price_lo_to = valueFloat;
if (float.TryParse(textBoxSPHighFrom.Text, out valueFloat))
sv.stock_price_high_from = valueFloat;
if (float.TryParse(textBoxSPHighTo.Text, out valueFloat))
sv.stock_price_high_to = valueFloat;
if (float.TryParse(textBoxSPACloseFrom.Text, out valueFloat))
sv.stock_price_adj_close_from = valueFloat;
if (float.TryParse(textBoxSPACTo.Text, out valueFloat))
sv.stock_price_adj_close_to = valueFloat;
if (int.TryParse(textBoxSVolumeFrom.Text, out valueInt))
sv.stock_volume_from = valueInt;
if (int.TryParse(textBoxSVolumeTo.Text, out valueInt))
sv.stock_volume_to = valueInt;
DataTable MSQ = DataLayer.Stock.MSQ(sv);
dataGrid.ItemsSource = MSQ.DefaultView;
catch (SqlException sqlex)
MessageBox.Show("Error: " + sqlex.Message, "Exception Sample", MessageBoxButton.OK, MessageBoxImage.Warning);
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
And you might want to mention which version of IE you're running, and which document mode it's running in. The Array.prototype.indexOf()[^] method is supported in IE9 and later, so it looks like you're either using IE8 or earlier, or you're stuck in an old document mode.