Click here to Skip to main content
11,484,752 members (64,353 online)

Comments by Mika Wendelius (Top 200 by date)

Mika Wendelius at 13-Apr-15 23:42pm View
Nice answer!
Mika Wendelius at 13-Apr-15 23:41pm View
Thanks :)
Mika Wendelius at 13-Apr-15 23:41pm View
Glad it helped
Mika Wendelius at 9-Mar-15 10:34am View
2 is just a parameter value for test purposes. When using this, you should pass whatever values needed to the method.
Mika Wendelius at 9-Mar-15 9:58am View
Thanks, didn't notice the tag :doh:
Mika Wendelius at 9-Mar-15 2:23am View
Thanks SA :)
Mika Wendelius at 9-Mar-15 1:02am View
In that case, you can perhaps use Pivot. Please see[^]
Mika Wendelius at 6-Mar-15 5:21am View
What was the problem? The % operator returns the modulo so it should be zero whenever quantity is divisible by 2
Mika Wendelius at 5-Mar-15 23:27pm View
You haven't posted the whole method but as far as there is code, it seems that you're missing the return statement.
Mika Wendelius at 5-Mar-15 4:54am View
If I understood correctly, then perhaps something like in the modified solution.
Mika Wendelius at 5-Mar-15 3:38am View
for ticketid 1001, how do you define owndate1 and owndate2. Are those min and max dates for that ticket for specific owner?
Mika Wendelius at 4-Mar-15 23:44pm View
When debugging the calling code, where do you get the exception? Most likely the exception isn't caused by the SQL code.
Mika Wendelius at 4-Mar-15 14:45pm View
This would be an efficient way to do the task. My 5.
Mika Wendelius at 4-Mar-15 14:44pm View
That would be needed! My 5
Mika Wendelius at 3-Mar-15 12:25pm View
You're welcome :)
Mika Wendelius at 2-Mar-15 0:28am View
Those links should be helpful :)
Mika Wendelius at 1-Mar-15 12:54pm View
Can you post the relevant parts as plain text into this question?
Mika Wendelius at 25-Feb-15 23:27pm View
I can't go through all of your code so using debugger, locate the line where the error happens and what is the error message. This way you have information for a new question.
Mika Wendelius at 25-Feb-15 23:21pm View
I'd also suggest on trying to do a minimal test project with your code and see if it can be reproduced and post the test project.
Mika Wendelius at 25-Feb-15 23:19pm View
Thanks CPallini
Mika Wendelius at 25-Feb-15 23:19pm View
Thanks SA
Mika Wendelius at 25-Feb-15 14:23pm View
I can't see your entire solution or what happens outside the method I wrote. So if the problem for this method is now solved, you can mark it as solved and open another question if you have problem somewhere else in the code. Just remember to post all relevant code parts with the question.
Mika Wendelius at 25-Feb-15 14:00pm View
I can't see that kind of line in the example I wrote. Are you using some other code?
Mika Wendelius at 25-Feb-15 13:52pm View
As far as I can see, that is the complete solution. Where do you get an error and what is the error you get?
Mika Wendelius at 25-Feb-15 13:28pm View
Sorry, forgot to change the return value type to decimal. The solution is now fixed.
Mika Wendelius at 25-Feb-15 13:07pm View
Are you sure you're creating the window in the UI thread, not in another thread?
Mika Wendelius at 25-Feb-15 12:56pm View
That would certainly help, 5
Mika Wendelius at 25-Feb-15 0:49am View
Did you set Cancel to true? See CancelEventArgs.Cancel[^]
Mika Wendelius at 24-Feb-15 23:48pm View
Why can't you write it? If you mean that the intellisense isn't showing it, just type in the code.

Mika Wendelius at 24-Feb-15 23:34pm View
Better in which sense, what is currently wrong with bulk insert?
Mika Wendelius at 24-Feb-15 23:27pm View
That's a good explanation!
Mika Wendelius at 24-Feb-15 23:26pm View
Thanks SA!
Mika Wendelius at 24-Feb-15 10:50am View
What tools (db, reporting, etl) you're using?
Mika Wendelius at 23-Feb-15 14:47pm View
What are the tables or collections you want to join?
Where are the fields FPersonalUser and typemanger defined?
Mika Wendelius at 23-Feb-15 14:40pm View
But what is the error you get?

From the documentation for ThreadStart:
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8
Mika Wendelius at 23-Feb-15 14:36pm View
Thanks SA :)
Mika Wendelius at 23-Feb-15 14:33pm View
In technical sense that is a valid statement so if adapt can appear in both fields title and author, then the query should be correct.
Mika Wendelius at 23-Feb-15 14:23pm View
You can download the VS 2008 SP 1 from here[^]
Mika Wendelius at 23-Feb-15 14:19pm View
Not sure if I understood the logic but based on your code in the other question you have an AND in the where clause for both Title conditions. This would mean that the title should be adapt and adaxx at the same time but that's not possible.

So you probably should have a query like
FROM Books b
WHERE ( b.Title LIKE '%adapt%' or b.Title LIKE '%adaxx%')
AND Category = 'fiction'.

However if you use the full texts for the title you don't need like and you can use IN operator. Like this
FROM Books b
WHERE b.Title IN ('adapt', 'adaxx')
AND Category = 'fiction'.

Is this getting towards correct direction?
Mika Wendelius at 23-Feb-15 14:13pm View
Thanks !
Mika Wendelius at 23-Feb-15 14:13pm View
Thank you !
Mika Wendelius at 23-Feb-15 14:13pm View
Thank you !
Mika Wendelius at 23-Feb-15 14:04pm View
Can you post a small example, based on the data in the question, what would your conditions be and what would you expect as a result?
Mika Wendelius at 23-Feb-15 13:52pm View
Agree, +5
Mika Wendelius at 23-Feb-15 13:34pm View
Your CASE statement inspects if the field category on a row contains a value 'fiction'. I wasn't sure what you wanted the result to be so I just added a constant literal 'found'. In other words for each row the select returns you get the text 'found' if the category is fiction. Is this something like you we're after or did you have something else in mind?
Mika Wendelius at 23-Feb-15 1:08am View
Why not test? Grab a Visual Studio and have a try. Using the debugger you can easily see what happens in each case.
Mika Wendelius at 23-Feb-15 0:17am View
Shape[] shapes = new Shape[3];
shapes[0] = new Shape(100, 100);
shapes[1] = new Square(200, 200);
shapes[2] = new Circle(300, 300);

If the array would be defined as Circle you wouldn't be able to add a Square into it.
Mika Wendelius at 22-Feb-15 23:44pm View
I agree, especially concerning down casting, however hopefully the OP gets a kick start from this.
Mika Wendelius at 22-Feb-15 23:27pm View
If it's not a store application, what is the exact error you're facing?
Mika Wendelius at 22-Feb-15 23:21pm View
I take it this is to concatenate all columns for a table and for all rows. Looks interesting.

I think you should have a cursor or something similar when looping through the table. Id's and row count do not necessarily match :)
Mika Wendelius at 22-Feb-15 23:15pm View
Solution updated for older versions.
Mika Wendelius at 22-Feb-15 14:04pm View
Glad it worked out
Mika Wendelius at 22-Feb-15 11:42am View
It seems that the code was just a diversion :)

Good links, 5.
Mika Wendelius at 22-Feb-15 11:15am View
Good options!
Mika Wendelius at 22-Feb-15 9:52am View
In that case have a look at Extending Visual Studio Setup Project[^]
Mika Wendelius at 22-Feb-15 9:42am View
What setup mechanism/program you use?
Mika Wendelius at 22-Feb-15 8:45am View
You're welcome :)
Mika Wendelius at 22-Feb-15 8:43am View
This is a far too big question to be answered in a single solution. Try to break down the problem, post a question concerning only one subject and state what you have already done.
Mika Wendelius at 22-Feb-15 8:40am View
Okay, I see. I truly believe that you shouldn't use this kind of design. Adding the columns daily is where your problem starts.

Instead of adding new columns, add new rows. So if you change the table to something like:
- roll_no
- attendance_date, date column
- present, 0 or 1

Then you can easily insert and query the data with a query like I wrote in the solution.

The main thing is that relational databases and SQL are designed to work with static structures. This is one of the reasons database normalization focuses on not repeating data and creating fixed entities.
Mika Wendelius at 22-Feb-15 8:25am View
I'm sorry but I don't quite understand. A table cannot have variable number of columns. The columns in a table are fixed.

Can you post few rows as an example data so it would be easier to understand the problem.
Mika Wendelius at 22-Feb-15 7:54am View
Few questions: What have you tried so far? Also can you post example data and the desired result
Mika Wendelius at 21-Feb-15 6:17am View
This really doesn't make any sense. I suggest that you try to eat the elephant in smaller pieces. Try to isolate the questions into single problems and then using google get more information about possible solutions and answers. At the moment it feels like we're just poking around...
Mika Wendelius at 21-Feb-15 6:14am View
Having another look, I think you're right.
Mika Wendelius at 21-Feb-15 6:06am View
Now this really feels like a homework and we don't do other people's homework. What have you done so far? Are you stuck in a specific question. If so, use the improve widget to add more information to your question and the code you have so far.
Mika Wendelius at 21-Feb-15 6:04am View
What is the problem you're facing, not able to do the selection based on another dropdown or what? What have you done so far?
Mika Wendelius at 21-Feb-15 6:02am View
That's true. However, since the OP wonders whether to C# or VB.NET I believe that familiarizing with ASP development wouldn't be a waste of time :)
Mika Wendelius at 21-Feb-15 5:53am View
Another thing is that you should pass the event as a parameter. So

Also instead of putting it on div, can you put it on body?
Mika Wendelius at 21-Feb-15 5:34am View
onkeypress isn't necessarily fired for Esc. Try onkeydown
Mika Wendelius at 21-Feb-15 5:28am View
If it throws an error when you put it in Excel, try your local separator. Mine is semicolon (;) but perhaps you have comma (,) or something else. So with comma the formula would be

Mika Wendelius at 21-Feb-15 5:22am View
You're welcome :)
Mika Wendelius at 21-Feb-15 5:03am View
Do you actually call the function somewhere? For example in ONKEYDOWN event?
Mika Wendelius at 21-Feb-15 4:27am View
Good point.
Mika Wendelius at 21-Feb-15 4:04am View
If you have included the compact database in your Visual Studio project, you most likely write over the database file each time you start the application. Meaning:
- the database is included in your project
- you run the project everything is copied into the bin/debug folder
- you make modifications, they are stored in the db file in bin/debug
- you stop the application
- you start it again and again everything is copied into bin/debug
The solution is to place the database file to a location where you want to keep it and define in the project that it is not copied.
Mika Wendelius at 21-Feb-15 3:58am View
That's a lot of time.
I think the easiest way id to go back to the version you had in the beginning (separate statements and temp tables), create the permanent indexes, and the take the execution plan from the first query, post the query and the plan as a new question in Q&A and let's see what we can think of.
Mika Wendelius at 21-Feb-15 3:11am View
Mika Wendelius at 21-Feb-15 3:09am View
Where do you get the error, where does the debugger stop at?
Mika Wendelius at 21-Feb-15 3:06am View
That's just a code dump. Do yo have any specific problems or questions you can point out?
Mika Wendelius at 20-Feb-15 4:04am View
That's a big question. I suggest thta you narrow down the problem to smaller, specific questions you have in mind and open a new question in Q&A
Mika Wendelius at 20-Feb-15 4:03am View
You're welcome.
Mika Wendelius at 20-Feb-15 4:02am View
Which database, Sql Server, Oracle, Access, MySql...
Mika Wendelius at 20-Feb-15 2:41am View
Better in which way?
Mika Wendelius at 20-Feb-15 2:29am View
Have you referenced the proper library? If you're using the newest version I think the correct assembly to add to references is DevExpress.XtraCharts.v14.2.UI.dll
Mika Wendelius at 20-Feb-15 2:06am View
Thank you :)
Mika Wendelius at 20-Feb-15 2:06am View
Thanks :)
Mika Wendelius at 20-Feb-15 2:06am View
Good addition, +5.
Mika Wendelius at 20-Feb-15 1:59am View
Looks good :thumbsup:
Mika Wendelius at 20-Feb-15 0:08am View
Instead of calculating and storing the total by yourself I suggest using computed columns. See Specify Computed Columns in a Table[^]
Mika Wendelius at 19-Feb-15 23:22pm View
You're welcome. By the way, instead of adding a new solution you can leave a comment on existing solution, just like this one. By adding a comment the person who wrote the solution gets notified and knows to come back :)
Mika Wendelius at 19-Feb-15 23:18pm View
If I'm right there seems to be one extra parenthesis, so remove one closing perenthesis before e
Mika Wendelius at 19-Feb-15 13:33pm View
That is true, good point!
Mika Wendelius at 19-Feb-15 13:09pm View
This depends highly on the context. A reporting application getting data from a far remote database is quite different from low level I/O driver. What kind of situation you have?
Mika Wendelius at 19-Feb-15 12:45pm View
You should create the three first indexes in the database and let them be. Do not include them in your query. The indexes will live by themselves in the database. Typically indexes are created just once and never dropped.

An exception is the last index. It should be created after filling the temp table so:

insert into #ecampMatch(email_source, campaign, date_time, cell_id, filename)
select distinct email_source, campaign, date_time, cell_id, filename
from master
where campaign in (select distinct campaign from ReportingAcxiom);

CREATE INDEX ecampMatch_campaign ON #ecampMatch (campaign, email_source, cell_id);
Mika Wendelius at 19-Feb-15 12:07pm View
Nice answer!
Mika Wendelius at 19-Feb-15 12:07pm View
Nice answer
Mika Wendelius at 19-Feb-15 11:55am View
Do you mean a total row or a total column?
Mika Wendelius at 19-Feb-15 11:52am View
Glad it was helpful :)
Mika Wendelius at 19-Feb-15 10:21am View
You can't see the new row in the database? If not, how did you verify it?
Mika Wendelius at 19-Feb-15 9:45am View
What do you mean by another process? Consider the following
if (cbProductDescription.SelectedItem.ToString() == "Prepaid - 300")
command.Parameters.AddWithValue("@Price", 7);
command.Parameters.AddWithValue("@Price", DBNull.Value);
Mika Wendelius at 19-Feb-15 9:36am View
Yes, I can see that based on your data. Again what is the actual table structure? Without knowing the table structure it's impossible to help you to write the statement.
Mika Wendelius at 19-Feb-15 9:04am View
As PIEBALDConsult pointed out the records are in no actual order. Is this really the structure of the database? can you post the Table definition, what columns it contains, what data types etc.
Mika Wendelius at 19-Feb-15 7:20am View
Yes, for example have a look at PHP Connect to MySQL[^]
Mika Wendelius at 19-Feb-15 6:51am View
CLR relies on the services provided by the OS. What is your concern exactly?
Mika Wendelius at 19-Feb-15 5:54am View
If it's a DLL you have made, why do you need to make changes into the DLL rather than change the source code?
Mika Wendelius at 19-Feb-15 2:30am View
If you don't have a value then I take it that in your scenario you should set the column as NULL in the database. In order to do that, define the value of the parameter to DBNull.Value[^]
Mika Wendelius at 19-Feb-15 2:14am View
I don't think that would work correctly. Based on the selection in the combo box you should define a value for both Price and Total in both cases. Otherwise you have a parameter in a query text but you don't provide any value to it.
Mika Wendelius at 19-Feb-15 1:03am View
If you want to use the data from another datatable as a filter, concatenate the value to the filter property. Like

dv.RowFilter="country_id = " + dr["country_id"].ToString();

I didn't quite understand how the stored procedure is related to this...
Mika Wendelius at 19-Feb-15 0:35am View
The length of the query is not likely the reason. What is the full error you get?

Also using debugger, copy the statement that is going to be executed in your code to the clipboard and try to run that in MySql. Does it run? This way you can ensure that the statement is exactly the same in both cases.
Mika Wendelius at 19-Feb-15 0:33am View
Please post the relevant part of the code you have made
Mika Wendelius at 19-Feb-15 0:23am View
Pictures method expects to get a number (index). If you pass a string or improper index number, then an error is generated.
Mika Wendelius at 18-Feb-15 23:54pm View
Thanks Maciej
Mika Wendelius at 18-Feb-15 23:29pm View
You're welcome :)
Mika Wendelius at 18-Feb-15 3:38am View
The length of the name of the column doesn't restrict the amount of data that can be stored into the column. It's just a name.

Can you post the code you're currently using?
Mika Wendelius at 18-Feb-15 1:09am View
So far you have just defined the requirement. What have you done, where are you stuck at?
Mika Wendelius at 18-Feb-15 0:33am View
Sorry but I don't quite understand the question. If the statement fails you will get an error message. The data shouldn't be truncated unless you manipulate it in some way.
Mika Wendelius at 17-Feb-15 1:40am View
It sounds like auto complete may not be the right solution in this case. If the amount of the data rows is so big that it takes too much time to fetch it, how would a user be able to select from the list?

Perhaps you should consider some mechanism to narrow the possibilities, peharps some more input from the user...
Mika Wendelius at 16-Feb-15 23:43pm View
That's true that the user needs to know few characters, but why would you fetch the data from the database each time? Just store it on the client side, for example in a datatable and select appropriate portion each time you need one. Having a database call in this kind of situation would be a performance killer.
Mika Wendelius at 16-Feb-15 4:44am View
That is why I used the COALESCE. It returns the first non null value :)
Mika Wendelius at 16-Feb-15 4:42am View
If a single month contains several invoices, what do you mean when you say that you want only Qty, not SUM(Qty)? For example if you have 2 invoices for January Qty 2 and 5, what should be shown in January?
Mika Wendelius at 15-Feb-15 5:35am View
In that case you need to build a small program. You can use PL/SQL to do it or some other language that can connect to the database.
Mika Wendelius at 15-Feb-15 5:32am View
You're welcome
Mika Wendelius at 14-Feb-15 3:27am View
Have a look at this:[^]. It doesn't contain the save to database code but there are a lot of examples for saving images to database.
Mika Wendelius at 13-Feb-15 13:26pm View
Good point, 5!
Mika Wendelius at 13-Feb-15 13:25pm View
As far as I know there's no single solution for both. However, the actual code can be shared if you use C# & mono
Mika Wendelius at 13-Feb-15 13:24pm View
Nice answer!
Mika Wendelius at 13-Feb-15 13:21pm View
You're still doing it wrong. The only correct way is to use parameters. Otherwise you're not able to control what the statement will be. For example if your password is ABC'DEF you will get a syntax error for the statement.

Try correcting the code to use the parameters this way we can concentrate on the actual problem if it still exists.
Mika Wendelius at 13-Feb-15 9:46am View
No, concatenating strings to SQL statements is evil. And when the data comes from a text box or similar it's even worse. Parameters is the correct way to go.
Mika Wendelius at 13-Feb-15 9:37am View
Some explanation added
Mika Wendelius at 13-Feb-15 9:15am View
Thank you Rohan :)
Mika Wendelius at 13-Feb-15 9:13am View
This is a completely different question so I advice you to open a new Question in Q&A.
Mika Wendelius at 13-Feb-15 8:57am View
What normalization do you mean? Quantile normalization, normalizing frequenxy for digital signals, database normalization or something else.

Also please explain what exact questions you have in mind? I'm asking these since currently the question is far too vague to be answered with anything more than few links...
Mika Wendelius at 12-Feb-15 15:39pm View
It really depends. Service based database must be installed separately and it can be multi user. Embedded database can be entirely embedded into your application but it's single user only.

To use compact edition in your VS project, refer to[^]
Mika Wendelius at 12-Feb-15 15:33pm View
Glad to help you :)
Mika Wendelius at 12-Feb-15 15:33pm View
Glad to help you :)
Mika Wendelius at 12-Feb-15 15:26pm View
Good choices!
Mika Wendelius at 12-Feb-15 15:08pm View
Good point
Mika Wendelius at 12-Feb-15 15:08pm View
Mika Wendelius at 12-Feb-15 15:06pm View
What is the database you're using? MySQL, Oracle, Sql Server...
Mika Wendelius at 10-Feb-15 10:38am View
The extension of the database file can be defined when the database is created but I believe that it's typical to use sdf extension.
Mika Wendelius at 5-Feb-15 0:32am View
Very nice answer.
Mika Wendelius at 5-Feb-15 0:31am View
Nice answer.
Mika Wendelius at 5-Feb-15 0:30am View
Thanks :)
Mika Wendelius at 5-Feb-15 0:30am View
Thank you :)
Mika Wendelius at 5-Feb-15 0:30am View
Thanks :)
Mika Wendelius at 27-Jan-15 0:45am View
Few things. You need to add the group by clause. Have a look at the link I posted earlier.

Another thing. What does SoldCount field contain. Is it already containing the count or do you need to sum the values in that field?
Mika Wendelius at 26-Jan-15 23:51pm View
Solution updated
Mika Wendelius at 26-Jan-15 8:34am View
Can you post what your code currently looks like
Mika Wendelius at 26-Jan-15 8:33am View
Glad to be of service
Mika Wendelius at 26-Jan-15 1:27am View
You're welcome :)
Mika Wendelius at 26-Jan-15 1:14am View
Thanks :)
Mika Wendelius at 26-Jan-15 0:22am View
One thing you could check is that does the program have both read and write access to the folder where the accdb file is and make sure that the file isn't read only.
Mika Wendelius at 25-Jan-15 23:38pm View
Just modify the select portion of the statement. Something like:
string sVariable = string.Join(",", dt.AsEnumerable().Select(x => "'" + x["Name"].ToString() + "'"));
Mika Wendelius at 25-Jan-15 23:36pm View
Are you sure that the driver is correct version. I mean if the program is 32 bit then the driver you have installed is 32 bit too.
Mika Wendelius at 25-Jan-15 10:35am View
No, as far as I know you can use version 12 with accdb files
Mika Wendelius at 25-Jan-15 7:16am View
If you need to do the counting in LINQ then you need to use GROUP BY clause. Have a look at How to: Group Query Results[^]
Mika Wendelius at 25-Jan-15 7:15am View
As far as I know that error message is related to dbase, foxpro and other ISAM based files, not Access.

Have you tried using a different provider:

Also if you have 64 bit environment make sure that you have the 64 bit drivers installed correctly.
Mika Wendelius at 25-Jan-15 4:08am View
What is the problem you're facing? Are you getting errors? Are users not able to log in or what?
Mika Wendelius at 25-Jan-15 4:07am View
As said, if you can, I'd suggest to replace the SQLite with SQL Server COmpact edition. Compact edition can be used offline and it can replicate data with the 'master' SQL Server instance
Mika Wendelius at 25-Jan-15 4:03am View
You're welcome :)
Mika Wendelius at 24-Jan-15 14:57pm View
What is the formula that would produce this series?
Mika Wendelius at 24-Jan-15 10:04am View
As pointed out by Chill60 try using brackets around the table name.
Mika Wendelius at 24-Jan-15 2:46am View
Glad you got it solved :)
Mika Wendelius at 23-Jan-15 16:22pm View
You're welcome :)
Mika Wendelius at 23-Jan-15 14:57pm View
That's great to hear! :)
Mika Wendelius at 23-Jan-15 14:56pm View
In that case your select should be something like
select ...
from employee e, employeestatus es
where e.employeeid = es.employeeid
and not exists
( select 1
from employeestatus es2
where es2.employeeid = es.employeeid
and es2.validfrom > es.validfrom)
Mika Wendelius at 23-Jan-15 14:41pm View
Thanks :)
Mika Wendelius at 23-Jan-15 14:30pm View
I believe it could help. Also if you can, check the mappings NHibernate has defined just to make sure that they are ok.
Mika Wendelius at 23-Jan-15 13:55pm View
Are you sure that you don't have a foreign key from Category to Skill? The error message implies that the foreign key is referencing to the Skill -table?
Mika Wendelius at 23-Jan-15 13:29pm View
Answer updated
Mika Wendelius at 23-Jan-15 13:25pm View
You can reply directly to the answer. I'll update it shortly.
Mika Wendelius at 23-Jan-15 13:03pm View
What error do you get?
Mika Wendelius at 23-Jan-15 10:04am View
Good catch thanks :) Fixed now.
Mika Wendelius at 23-Jan-15 2:33am View
As far as I can see this is a portable solution as long as you also send the rdp file. The rdp file is actually a simple text file. You can use notepad to open it and see the content.
Mika Wendelius at 23-Jan-15 1:20am View
Thanks :)
Mika Wendelius at 23-Jan-15 1:19am View
Can you give an example source data
Mika Wendelius at 22-Jan-15 23:57pm View
Please don't repost. You already asked this question here: How to move the data from one ndf to another ndf file . . . . . .[^]
Mika Wendelius at 22-Jan-15 23:47pm View
If updating statistics fixed the situation and it occurred again you may be facing a plan stability problem. This means that the database engine cannot decide a good plan and and it changes. Usually these kinds of problems can be solved by changing indexes, simplifying statement or using hints.

However, have you made sure that it's not a workload problem. Meaning that when this happens, the server is under heavy stress? Use Windows performance monitor to see the CPU load and if the server is swapping
Mika Wendelius at 22-Jan-15 9:51am View
You're welcome :)
Mika Wendelius at 22-Jan-15 8:14am View
Mika Wendelius at 22-Jan-15 3:51am View
Without going through all your code it's quite impossible to say if that code excerpt fine or not. I suggest going thruogh the code using debugger and to see what are the values you're trying to add to the tables and in which order.
Mika Wendelius at 22-Jan-15 3:49am View
It looks like you're trying to use Named pipes protocol from the client side. By default that protocol isn't enabled. I suggest that you use TCP/IP but if you want, you can enable Named Pipes on the server side using Sql Server configuration tool
Mika Wendelius at 22-Jan-15 2:07am View
With default instance you don't specify a name. Did you try copying the connection string from SSMS?
Mika Wendelius at 22-Jan-15 0:56am View
NO, you never share the database files or other file resources from the DB server. TP is enough taken that:
- server listens in default port (1433)
- you don't have named instances

If you have named instances or another port, those should be defined in the connection string.

Try to establish the connection on the server using for example SSMS and when succesfull copy the connection string from SSMS properties window.
Mika Wendelius at 22-Jan-15 0:54am View
Glad to be of service :)
Mika Wendelius at 22-Jan-15 0:50am View
From the technical point of view yes, but the correctness of the expression is defined by the need. In other words, it depends on what you need to fetch :)
Mika Wendelius at 21-Jan-15 23:11pm View
Have a look at this, it should help you to find the correct window[^]
Mika Wendelius at 21-Jan-15 13:32pm View
The problem with your question is that you haven't proven that you have put some effort into it. If you post what you have tried so far and where you got stuck I believe you'll get good answer. However, if you let the question be as-is, people interpret it so that you're trying to get them to do your homework.

So the key thing is to show that you have really done something and to clearly point out what is hard to figure out. After all the whole point of your assignment is that you learn how to do such things. In other words learning is an investment to yourself :)
Mika Wendelius at 21-Jan-15 13:21pm View
Done, next please :)
Mika Wendelius at 21-Jan-15 8:39am View
Why do you say it's not working? Can you post the code you have tried.

In overall, I really don't suggest that you use the approach presented in solution 2. In my opinion you should rely on tested mechanisms that are built in in the framework instead of coding an alternative.
Mika Wendelius at 21-Jan-15 8:36am View
Glad to be of service :)
Mika Wendelius at 21-Jan-15 1:00am View
Removed username and password from the connection string
Mika Wendelius at 20-Jan-15 0:55am View
You're welcome :)
Mika Wendelius at 20-Jan-15 0:25am View
Do you get an error message or have some other kind of problem?
Mika Wendelius at 19-Jan-15 3:52am View
Of course the client side also affects. Why not test with another client computer. Also double check the connection string and the instance name.
Mika Wendelius at 19-Jan-15 1:17am View
Glad it helped :)
Mika Wendelius at 18-Jan-15 9:47am View
Yep, indexing. Proper indexing is the key to fast access. Also you have to consider limiting the time frame. Do you always calculate all the starts and stops from all time beginning or for example only for last week or so.
Mika Wendelius at 18-Jan-15 9:45am View
In that case I guess the best option is to define what is the maximum amount of columns to be generated (in your example it was 4) and then select the items (Ball, Apple, Dog etc) based on their alphabetical order...
Mika Wendelius at 17-Jan-15 15:27pm View
Good point!
Mika Wendelius at 17-Jan-15 14:11pm View
Nice suggestion.
Mika Wendelius at 17-Jan-15 13:58pm View
Could be...

Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid