Click here to Skip to main content
12,887,625 members (31,612 online)

Comments by Maciej Los (Top 200 by date)

Maciej Los 3hrs 20mins ago View
Caroline, you're great teacher!
Maciej Los 4hrs ago View
Maciej Los 4hrs ago View
Have you, tried my solution? Seems, you don't, because the second column in select statement is the name of the group.
Maciej Los 4hrs ago View
Thank you, Karthik.
Maciej Los yesterday View
"I want to change their email domain" - and the issue is...
Maciej Los yesterday View
Not a question at all!
Maciej Los yesterday View
"Not work propelry" is not informative at all!
Maciej Los yesterday View
On the first lok, below statement:
CAST(DATEDIFF(Minute,FromDate, ToDate) / 60 AS VARCHAR(5)) + ' Hrs' + ':' + RIGHT('0' + CAST(DATEDIFF(Minute, FromDate, ToDate) % 60 AS VARCHAR(2)), 2) + ' Min' AS 'Hr'

returns strings like this: 9 Hrs:22 Min
So, you can't simply sum up values stored in such of string. You need to remove "Hrs" and "Min" from that string, then to split string into 2 fields: hours and mins. At the and, you'll be able to sum it up!
Maciej Los yesterday View
You may need to write and install windows service...

How to get the status of a printer and a print job - MSDN
Maciej Los yesterday View
Such of statement: var sentence = from l in doc.Descendants() select (string)l.FirstNode.NextNode.NextNode.ToString() is incorrect.
You should provide more details about your issue, especially what you want to return.
Maciej Los yesterday View
Sorry, but what have you tried? Where are you stuck?
Show your code and expected output.
Maciej Los yesterday View
If the first element of array is on position (index) 0, then the 4. element of array points out to... nothing (out of array).
index: | 0 | 1 | 2 | 3 |
array: | 1 | 9 | 8 | 7 |

You should carefully read my answer and related articles first rather then tranfer your angry onto me.
Maciej Los yesterday View
I've already told you. It's because of conversion between string and datetime!
Maciej Los 2 days ago View
Can you post example data and expected output?
Maciej Los 4 days ago View
What's your code?
Maciej Los 19-Apr-17 4:33am View
At this moment a Subject doesn't contain property which returns string (Hindi, English, etc.)

What have you tried? Where are you stuck?
Maciej Los 19-Apr-17 4:30am View
There's no need to "cast the result to an array", becuase Join method acceppts IEnumerable(Of T).
Check this!
Maciej Los 19-Apr-17 4:17am View
Maciej Los 19-Apr-17 4:16am View
You're very welcome
Maciej Los 18-Apr-17 16:27pm View
Maciej Los 18-Apr-17 16:01pm View
i found some references about - use that logic!
Maciej Los 18-Apr-17 7:10am View
Have you tried to run your SQL statement on SQL server?
Maciej Los 18-Apr-17 7:06am View
Yeah, it's quite easy to resolve, but OP have to be warned about... see my answer.
BTW: 4!
Maciej Los 18-Apr-17 4:02am View
We can't read in your mind or direct from your screeen. Could you be more specific and provide more details?
Maciej Los 18-Apr-17 2:38am View
Dave, there's no need to install Access 2003 Runtime. As you mentioned, installing Access 2013 (or 2010) would be enough. At this moment i do not understand what OP is trying to say us. Is He using WinForms on IIS server?
Maciej Los 18-Apr-17 2:32am View
This is not an answer. Please delete it to avoid downvoting. To post comment, please use "Have a Question or Comment" widget.
Maciej Los 16-Apr-17 12:40pm View
RowCount or Rows.Count isn't enough?
Maciej Los 15-Apr-17 15:12pm View
No. I'm bit busy. This lasts few months...
Maciej Los 15-Apr-17 14:50pm View
Looks good to me ;)
Maciej Los 11-Apr-17 15:35pm View
Have you solved your issue?
Maciej Los 11-Apr-17 14:18pm View
And... What kind of result do you expect?
Maciej Los 11-Apr-17 11:18am View
Maciej Los 10-Apr-17 16:44pm View
Maciej Los 9-Apr-17 15:31pm View
OK. We're waiting :)
Maciej Los 9-Apr-17 14:20pm View
I see the result of your job, but where is a code?
Maciej Los 9-Apr-17 14:10pm View
This is not an answer. Please, delete it. Use "Improve question" widget to update your question with details.
Maciej Los 9-Apr-17 13:55pm View
You're very welcome!
Maciej Los 7-Apr-17 13:44pm View
"I want to know more efficient code than the below" - this is not a question at all!
Maciej Los 6-Apr-17 12:26pm View
Not a question at all!
Maciej Los 2-Apr-17 10:45am View
Few words about sql injection will be welcome ;)
Maciej Los 27-Mar-17 2:13am View
A statement: "the size is my problem" - is not informative at all!
Maciej Los 27-Mar-17 2:02am View
To be able to parse json data, you have to: deserialize json data(recommended solution) or parse text(bad idea!).
Maciej Los 23-Mar-17 15:32pm View
You have to use debugger.
Maciej Los 23-Mar-17 15:30pm View
Sorry, but your question is not clear. Please, note that we can't read in your mid or direct from your screen. Improve your question and provide more details. A piece of VBA code you're trying to use can help us to understand your question.
Maciej Los 23-Mar-17 15:12pm View
Debugging a program is very good advice. +5
Maciej Los 23-Mar-17 15:07pm View
What have you tried? Where are you stuck?
Maciej Los 22-Mar-17 11:59am View
What is exact error message? Please, improve your question and provide that message.
Maciej Los 22-Mar-17 11:56am View
Sorry, but your question is not clear. We can't read in your mind or direct from your screen. Please, be more specific and provide more details.
Maciej Los 22-Mar-17 11:38am View
Thank you, Karthik.
Maciej Los 21-Mar-17 17:32pm View
One of possible resources ;)
Maciej Los 21-Mar-17 17:29pm View
Thank you, Karthik.
Link corrected ;)
Maciej Los 20-Mar-17 11:22am View
Sorry, but your question is not clear! We cannot read in your mind or direct from your screen ;(
Maciej Los 20-Mar-17 10:16am View
I do not see company name in you XML data! There's pname only!
Maciej Los 20-Mar-17 9:10am View
Maciej Los 13-Mar-17 17:41pm View
Well, what to say to version 13? WOW!
Maciej Los 13-Mar-17 16:59pm View
Good point!
Maciej Los 13-Mar-17 16:51pm View
And the problem is...
Maciej Los 13-Mar-17 16:44pm View
Maciej Los 13-Mar-17 16:06pm View
I was lazy. My answer is much shorter.
Maciej Los 12-Mar-17 15:44pm View
Maciej Los 12-Mar-17 15:39pm View
Maciej Los 10-Mar-17 10:57am View
Thank you, Karthik.
Maciej Los 9-Mar-17 16:14pm View
Maciej Los 9-Mar-17 16:14pm View
Thank you, Carlo.
Maciej Los 9-Mar-17 1:57am View
"Not working for me" is not informative at all!
Seems you haven't read related articles, because an author of second article ("Convert...") provides a custom way to convert word document into pdf.
Maciej Los 8-Mar-17 13:26pm View
You're very welcome.
Maciej Los 7-Mar-17 13:33pm View
Maciej Los 7-Mar-17 2:07am View
Maciej Los 7-Mar-17 1:54am View
And the answer is not related to the OP question. OP wants to "bound" (whatever it means) xml files, but the method he wants to use is unknown.
Maciej Los 7-Mar-17 1:50am View
Thank you, Karthik.
Maciej Los 6-Mar-17 14:18pm View
Use ToList() method on the end of query ;) This should help you resolve multiple database call.
Maciej Los 6-Mar-17 14:01pm View
Maciej Los 6-Mar-17 14:00pm View
Sorry, i don't get you...
Maciej Los 6-Mar-17 13:10pm View
Couldn't be more precise.
Maciej Los 5-Mar-17 15:00pm View
Maciej Los 5-Mar-17 14:44pm View
Thank you, Ralf.
Maciej Los 5-Mar-17 14:27pm View
Short And To The Point!
Maciej Los 5-Mar-17 3:53am View
What part of above code is confusing you?
Maciej Los 5-Mar-17 3:40am View
Maciej Los 5-Mar-17 3:28am View
You should provide sample string.
Maciej Los 4-Mar-17 13:52pm View
As to me - baked.
Maciej Los 3-Mar-17 13:49pm View
It goes without saying ;D
Maciej Los 3-Mar-17 13:14pm View
Short And To The Point!
Maciej Los 3-Mar-17 13:08pm View
Thank you, Karthik.
Maciej Los 2-Mar-17 11:51am View
Maciej Los 2-Mar-17 11:04am View
Didn't knew it. Good to know.
Maciej Los 2-Mar-17 11:02am View
Take a look at OP's data:
1 119 1
1 119 0

Player 119 played 2 matches with the same ID. So, your query will return 2 matches, but OP wants to return only 1. Got it?
Maciej Los 2-Mar-17 10:42am View
This won't return distinct MatchId ;(
Maciej Los 2-Mar-17 10:40am View
Maciej Los 2-Mar-17 8:51am View
Maciej Los 28-Feb-17 11:02am View
Ok, but you have to ask another question.
Maciej Los 28-Feb-17 9:40am View
Thank you, Caroline. We haven't got to go into bragging match in which link is more relevant than other. Both are worth 5 ;)
Maciej Los 28-Feb-17 9:37am View
You can't. You have to open it to be able to read its content. The same as you doing it in real. ;)
Maciej Los 28-Feb-17 8:47am View
Well said!
Maciej Los 27-Feb-17 15:05pm View
It's called a polymorphism!
One way to create more universal form of above method is to create it this way:
 public override void disableDiversion(Key k)
Maciej Los 27-Feb-17 14:53pm View
Maciej Los 27-Feb-17 14:51pm View
I know nothing about 2 dimensional excel... What it is?
Maciej Los 27-Feb-17 14:47pm View
Maciej Los 27-Feb-17 13:23pm View
Maciej Los 26-Feb-17 11:10am View
Great idea!
Maciej Los 26-Feb-17 10:48am View
Why do you need such of functionality?
Maciej Los 26-Feb-17 9:33am View
So, shouw us what have you tried...
"Not work..." is not informative at all!
Maciej Los 26-Feb-17 8:32am View
Maciej Los 26-Feb-17 8:32am View
Maciej Los 26-Feb-17 8:28am View
Maciej Los 26-Feb-17 8:25am View
Maciej Los 25-Feb-17 4:29am View
Maciej Los 25-Feb-17 4:11am View
So you deserved for loud bravos!
Maciej Los 25-Feb-17 4:06am View
This seems to be an answer ;)
Maciej Los 25-Feb-17 4:01am View
Maciej Los 24-Feb-17 13:53pm View
I have no idea too! :laugh:
Maciej Los 24-Feb-17 13:46pm View
Maciej Los 24-Feb-17 13:28pm View
A stored procedure returns data, which you can load into Dictionary object.
Your login is: SmartDeveloping, so you have to be smart to develop your application.
Maciej Los 24-Feb-17 12:52pm View
Well, you can check it out.
Maciej Los 24-Feb-17 11:33am View
Sorry, Peter, but conversion of varchar data into date is common reason of errors. Please, see my solution.
Maciej Los 23-Feb-17 14:55pm View
It can't be so easy! :laugh
Maciej Los 23-Feb-17 14:53pm View
An idiot's guide beat me!
Maciej Los 23-Feb-17 13:12pm View
Well, i understand that you'd say exactly the same ;)
Maciej Los 23-Feb-17 13:03pm View
There are general instruction about resolving debuger exceptions.
Maciej Los 23-Feb-17 12:59pm View
Thank you, Karthik.
Maciej Los 23-Feb-17 10:57am View
Short and to the point.
Maciej Los 23-Feb-17 10:28am View
You're very welcome.
Maciej Los 23-Feb-17 2:43am View
Maciej Los 23-Feb-17 2:21am View
Sorry, but it's your homework. I'd suggest to start with MSDN documentation. Use Google and type: "C# class msdn". When you get stuck, come back here and ask detailed question.
Don't get me wrong... I can give you a fish, but i'd rather give you a fishing rod.
Maciej Los 23-Feb-17 2:08am View
You're very welcome.
Maciej Los 22-Feb-17 16:36pm View
Maciej Los 22-Feb-17 16:08pm View
My virtual 5!
Maciej Los 22-Feb-17 15:43pm View
Maciej Los 22-Feb-17 15:24pm View
You're pretty close. Please, see my answer.
Maciej Los 22-Feb-17 15:24pm View
Maciej Los 22-Feb-17 9:14am View
Lines? Excel does not contain lines? There are cells, ranges, names, etc.
Please, be more specific and provide more details
Maciej Los 22-Feb-17 9:09am View
C#, VB.NET - what's the difference? If Claudio feels better with VB.NET, let continue His job in that programming language...
Maciej Los 22-Feb-17 8:59am View
A structure of json data look like:

Take a look at this CP article
Maciej Los 22-Feb-17 6:47am View
You're very welcome. Please, accept my solution (green button).
Maciej Los 22-Feb-17 2:35am View
A save way to open zip file and enumerate its content is:
using (System.IO.Compression.ZipArchive archive = System.IO.Compression.ZipFile.OpenRead(fullPath))
    foreach (System.IO.Compression.ZipArchiveEntry entry in archive.Entries)
		Console.WriteLine("{0}", entry.FullName);

For further details, please see: ZipArchive Class
Maciej Los 22-Feb-17 2:13am View
You're very welcome. Please delete your solution (to avoid down-voting), because it isn't solution, but comment. To post comment, use "Have a Question or Comment" widget.
Maciej Los 22-Feb-17 2:00am View
Maciej Los 22-Feb-17 1:58am View
Sorry, i don't get you...
Does above code sample doesn't show how to achieve that?
Maciej Los 22-Feb-17 1:57am View
Have you read about NTILE function?
Have you tried to change the sample to your needs?
Maciej Los 21-Feb-17 15:55pm View
Sounds reasonable ;)
Maciej Los 21-Feb-17 14:56pm View
Why to add another variable? If you can compare incoming data with existing one, you can call database updating procedure only when data has been changed.
Maciej Los 21-Feb-17 9:17am View
Have you closed zip file before further processing?
Maciej Los 21-Feb-17 6:21am View
You have to provide full file name of zip file.
Maciej Los 21-Feb-17 5:14am View
So, i'd suggest to read this: Appropriate Uses For SQLite The most important information is:
Client/Server Applications
If there are many client programs sending SQL to the same database over a network, then use a client/server database engine instead of SQLite.
Maciej Los 21-Feb-17 3:54am View
Insert that code into Button_Click subroutine.
Maciej Los 21-Feb-17 2:42am View
Yes, you can do that. All you need to to is to set up startdate and enddate, for example:
DateTime startdate = DateTimePicker1.Value;

Please, accept an answer as a solution (green button).
Maciej Los 21-Feb-17 2:06am View
Thank you, Garth.
Maciej Los 20-Feb-17 16:58pm View
Good idea!
Maciej Los 20-Feb-17 16:57pm View
Thank you, Graeme.
Maciej Los 20-Feb-17 16:54pm View
Check updated answer ;)
Maciej Los 20-Feb-17 14:52pm View
Do you need to use buttons? I've read that ToggleGroup would be much, much better for your requirements.
Maciej Los 20-Feb-17 9:56am View
Sorry, i don't see your data, so i can't help you. Keep trying!
Maciej Los 20-Feb-17 8:40am View
You should provide input data and expected output.
At this moment we know nothing about the structure of table(s), etc.
Maciej Los 20-Feb-17 8:06am View
Seems, you haven't read requirements: "Special care should be taken to make it as efficient as possible: loops are a poor idea!"
Maciej Los 20-Feb-17 7:59am View
Maciej Los 20-Feb-17 6:40am View
This is a solutioin - for sure - even if it's your opinion (advice).
Maciej Los 20-Feb-17 2:45am View
Maciej Los 20-Feb-17 2:45am View
Maciej Los 20-Feb-17 2:43am View
Do you want to use it in multi-user or single-user environment?
Maciej Los 20-Feb-17 2:27am View
Help what?
Maciej Los 20-Feb-17 1:55am View
You have to check if ddlAge is not null before you start binding.
Check this: FindControl
Maciej Los 19-Feb-17 15:22pm View
What have you tried? And where are you stuck?
Maciej Los 19-Feb-17 15:11pm View
So, in a cell A3 of Sheet2 insert <> as criteria.
More at: Advance Filter to Display Rows with Non-Blank Values
Maciej Los 19-Feb-17 12:31pm View
You're very welcome
Maciej Los 19-Feb-17 12:30pm View
You have to add another field in criteria and leave it empty, then modify code ;)
Maciej Los 19-Feb-17 9:52am View
Seems, i forgot to add a range to srcwsh. Please check my answer after changes. If it meets your criteria, please accept it (green button).
Maciej Los 19-Feb-17 9:40am View
Not sure what you want to achieve. Can you explain it?
Maciej Los 19-Feb-17 6:22am View
My philosophical nature says: do i have to take a part in competitions?
Maciej Los 19-Feb-17 6:05am View
I've been there ;)
Maciej Los 18-Feb-17 10:34am View
Chris, thanks for explanation.

Graeme, forgive me if i offended you. It wasn't my intention. I started my programming journey with Pascal and VBA. I have got medium experience with C++. Now, i'm using VB.NET and C# (prefered). As you can see, i'd be able to provide 5 solutions, but the idea to resolve issue would be the same. So, i'd rather to provide one solution (in any language). That's my point of view.

Maciej Los 17-Feb-17 8:30am View
Maciej Los 17-Feb-17 8:30am View
You're very welcome.
Maciej Los 17-Feb-17 8:29am View
Can you tell me the most important idea of coding challenge? Till now, i've been sure that the most important thing is to provide one unconventional solution, but now i see that coding chalenge has been changed into "How many programming languages you know?". I'd suggest to post the rules of coding challenge. If the method of resolving issue is the same (the same idea), the count of solutions couldn't be the reason of glory (upvotes).
Note: i see nothing wrong with six or more solutions of Graeme_Grant: F#, Linq and non-Linq version of C# and VB.NET, PowerShell, BatchScript, WPF(?!?), but... it stinks of bragging.
Maciej Los 17-Feb-17 7:27am View
To say "Thank you" use "Have a Question or Comment" widget under each solution.
Please delete this "answer", because it isn't an answer (solution).
Maciej Los 17-Feb-17 4:26am View
Replace var row = ListBox1.SelectedItem.Text; with var row = ListBox1.SelectedItem.Value;
Maciej Los 17-Feb-17 3:27am View
Does CFP_ID field is numeric data type? Seems, it's numeric. So, why you're using '' aroud its value? This causes the database engine to treat it as string value.
I'd try something like this:
Hide   Copy Code
Dim cb As String = "Update CourseFeePayment set PaymentID=@d2, AdmissionNo=@d3, Session=@d4,TotalFee=@d6, DiscountPer=@d7, DiscountAmt=@d8, PreviousDue=@d9, Fine=@d10, GrandTotal=@d11, TotalPaid=@d12, ModeOfPayment=@d13, PaymentModeDetails=@d14, PaymentDue=@d16 where CFP_ID=@d1"

Never use concatenated text as command text, because of SQL Injection.
Maciej Los 17-Feb-17 3:21am View
You're very welcome.
Maciej Los 17-Feb-17 3:21am View
Thank you, Karthik.
Maciej Los 15-Feb-17 9:36am View
Well... a challenge has been defined as: Given a collection of items (...whatever) determine the set of subitems in that collection that are repeated. So, there must be some way to compare objects. IEqualityComparer seems to be the best way for object's comparison.
Maciej Los 15-Feb-17 1:50am View
In a short: because of usage IEqualityComparer<T>, so any of data type can be used.
Maciej Los 14-Feb-17 16:30pm View
Looks good to me and your solution is more generic than others ;)
Maciej Los 10-Feb-17 2:13am View
Do not repost![^]
Maciej Los 9-Feb-17 14:32pm View
Maciej Los 8-Feb-17 4:04am View
VB6? Seems, it's VB.NET...
Maciej Los 8-Feb-17 2:09am View
Maciej Los 8-Feb-17 1:57am View
And what is wrong with your code?
Maciej Los 8-Feb-17 1:55am View
What version of PowerPoint? For 2007 and higher you can use OpenXml.
Maciej Los 8-Feb-17 1:49am View
Sorry, but your question is not clear. Seems, you have declared proper data type. If VS hangs on exit, you have to re-install it.
Maciej Los 7-Feb-17 15:05pm View
I really do like links under the line ;)
Maciej Los 6-Feb-17 11:17am View
As to the 5. - go to sleep, rest and get back to work ;)
SO: Convert HTML to PDF in .NET
Maciej Los 6-Feb-17 11:16am View
You mean, you want to bind data on muliple selectection on TreeView? For example, if user select 1., 3. and 5. node, you want to bind data with corresponding id to datagridview?
Maciej Los 6-Feb-17 5:46am View
And what is your issue?
Maciej Los 6-Feb-17 2:24am View
Why? You can re-write vba method into .net. It would much much easier.
Maciej Los 6-Feb-17 2:13am View
Have you tried to add reference to System.Collections.Generic? See: List<T> Class
Maciej Los 5-Feb-17 14:58pm View
My virtual 5!
Maciej Los 5-Feb-17 14:56pm View
Seems, you want to get books and chapters names. If i'm not wrong, you have to use SelectMany instruction.
Maciej Los 2-Feb-17 8:21am View
Maciej Los 2-Feb-17 8:15am View
Doesn't work is not informative at all. Please, provide more details (improve question) and let me know about that. I'll try to improve my answer.
Maciej Los 2-Feb-17 8:14am View
Trully... i don't know what kind of result OP expect to return.
Maciej Los 2-Feb-17 8:10am View
Thank you, Caroline.

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