Click here to Skip to main content
11,921,353 members (69,770 online)

Comments by Amir Mahfoozi (Top 200 by date)

Amir Mahfoozi 6-Jan-14 13:30pm View
Amir Mahfoozi 6-Jan-14 4:38am View
You can serialize your ArrayList and store it in a text data type.
Amir Mahfoozi 6-Jan-14 2:52am View
It seems that it is a UI problem and not a SQL one. Just get plain data ordered by seller and group them in UI (whether report or grid).
Amir Mahfoozi 6-Jan-14 0:51am View
What is the id field in Vehicle-schedule table ? is it for its own table or it points to a vehicle ? In both states it is not a good design.
Amir Mahfoozi 4-Jan-14 6:44am View
Amir Mahfoozi 4-Jan-14 6:44am View
Amir Mahfoozi 22-Dec-13 6:45am View
use Constraints.
Amir Mahfoozi 21-Dec-13 4:56am View
You're welcome.
Amir Mahfoozi 17-Dec-13 3:56am View
In this case everything is like SQL Server but for "IIF(ISNULL" part you can replace it with COALESCE function.
Amir Mahfoozi 16-Dec-13 7:28am View
Amir Mahfoozi 10-Dec-13 6:17am View
You're welcome Kamal.
Amir Mahfoozi 9-Dec-13 4:57am View
declare @s varchar(50) = '6.78'
select case when charindex('.', @s)>0 then
cast((substring(@s,1 , charindex('.', @s)-1) +substring(@s, charindex('.', @s) +1 ,len(@s) ) / 60) as varchar(50)) +
'.'+cast((substring(@s, charindex('.', @s) +1 ,len(@s) ) % 60) as varchar(50))
Amir Mahfoozi 9-Dec-13 2:46am View
Thank you :)
Amir Mahfoozi 9-Dec-13 2:39am View
+5 !
Amir Mahfoozi 8-Dec-13 0:53am View
Please read here :
Amir Mahfoozi 3-Dec-13 2:47am View
Pay attention that testing this code in a local network will give you a different result rather than testing it on a live server.
Amir Mahfoozi 2-Dec-13 2:22am View
Thank you.
Amir Mahfoozi 1-Dec-13 2:10am View
You're welcome.
Amir Mahfoozi 25-Nov-13 7:33am View
Ok I got it.
Amir Mahfoozi 25-Nov-13 7:01am View
Replace "Select Tel" with "Delete" and all of them will go.
Amir Mahfoozi 7-Nov-13 8:19am View
Remeber to turn on the "Overwrite the existing database (WITH REPLACE)" option in "Options" tab.
Amir Mahfoozi 6-Nov-13 1:55am View
How should we answer to this question ?
Amir Mahfoozi 5-Nov-13 7:22am View
You're welcome.
Amir Mahfoozi 6-Jun-13 15:40pm View
You're welcome.
Amir Mahfoozi 26-May-13 4:23am View
Both of them are pointer types so we can say there is no difference between them regarding to the value types they are storing. But in some cases it may be necessary to cast them to each other. But whatever you can do with the first one can be done with the second one.
Amir Mahfoozi 25-May-13 5:06am View
Here is one solution : Make a table containing two fields : one of them containing FL,IF,VVS,VVS1,VVS2,SI,SI1,I1,I2 and the other one contains order values: 1,2,3,4... . then join related tables to this table and filter the order value for the required range.
Amir Mahfoozi 8-May-13 5:11am View
Please read here :
Amir Mahfoozi 7-May-13 7:21am View
Move the "return getno" line to the line after "end select".
Amir Mahfoozi 7-May-13 0:43am View
Have you tried Google ?
Amir Mahfoozi 6-May-13 6:11am View
Add a flag variable and set it to true at the end of your thread function.
In the main function set it to false and after creating the thread wait until the flag gets true.
Amir Mahfoozi 5-May-13 1:15am View
The answer in stackoverflow seems correct :
Amir Mahfoozi 5-May-13 1:14am View
Amir Mahfoozi 6-Apr-13 7:49am View
No it should be "if((X % 2) != 0)"
Amir Mahfoozi 6-Apr-13 7:44am View
change "string filterQuery;" to "string filterQuery = string.Empty;"
Amir Mahfoozi 13-Feb-13 3:00am View
ROW_NUMBER() function will help you achieve this new column. Do a research on it and try it till getting the result.
Amir Mahfoozi 13-Feb-13 1:08am View
+5, Well done.
Amir Mahfoozi 3-Feb-13 23:58pm View
Amir Mahfoozi 27-Jan-13 3:31am View
Good Luck
Amir Mahfoozi 27-Jan-13 3:06am View
Thank you Sergey.
Amir Mahfoozi 27-Jan-13 3:01am View
Amir Mahfoozi 27-Jan-13 3:00am View
Amir Mahfoozi 21-Jan-13 1:04am View
why don't you define a default value of "getdate()" for the time field at the database level ?
You can ignore this field when inserting new data to the table. It automatically gets server time of insertion.
Amir Mahfoozi 6-Jan-13 2:08am View
Please tell us what the registerAS data type is?
Amir Mahfoozi 5-Jan-13 8:02am View
start SSMS -> click on New query -> right click in editor area -> select Design Query in Editor... : this wizard will help you to join tables and get the result.
Good Luck
Amir Mahfoozi 4-Jan-13 7:01am View
In my opinion it was just an option. If you want to use row_number result for further operations it is necessary to use "temporary tables" or "derived tables" or "multiple CTEs" in one query statement.
Amir Mahfoozi 24-Dec-12 3:12am View
It seems that you can update Employee_Details table with a single SQL statement ,so probably no need to use cursors.
Please provide a numerical example.
Amir Mahfoozi 19-Dec-12 2:36am View
I don't need that function.
If OP reads your comments he should create his own function. ;)
Amir Mahfoozi 19-Dec-12 2:27am View
The OP clearly says :
Unfortunately I am getting results in above format (like 0:3 which is wrong practice)
So your query will not work correctly for this type of input :
Select '0:31' as 'Duration'
Select '3:1' as 'Duration'
Amir Mahfoozi 19-Dec-12 2:23am View
According to this sample data type '33:14:14' in the question,
converting to datetime will always fail.
Amir Mahfoozi 19-Dec-12 2:01am View
Also think about this case :
Select convert(datetime,'1900-01-01 33:12:39') as 'Duration'
Amir Mahfoozi 19-Dec-12 1:55am View
Have a look at the result of this query :
SELECT Duration , convert(numeric,(replace(duration,':',''))) from
Select '33:14:14' as 'Duration'
Select '1:16:36' as 'Duration'
Select '0:3' as 'Duration'
Select '0:29' as 'Duration'
Select '0:31' as 'Duration'
Select '3:0' as 'Duration'
Select '0:29' as 'Duration'
Select '02:12:39' as 'Duration'
as a
order by convert(numeric,(replace(duration,':','')))
Amir Mahfoozi 16-Dec-12 2:23am View
Amir Mahfoozi 16-Dec-12 2:18am View
Maybe calling the BeginTransaction with specifying the transaction level solve your problem : so try to call it by this way : BeginTransaction(IsolationLevel.ReadUncommitted).
Good Luck.
Amir Mahfoozi 15-Dec-12 7:57am View
Amir Mahfoozi 26-Sep-12 12:25pm View
Rounding has a definition and the output that you want is not rounding. Firstly define your algorithm and then implement it in a user defined scalar function. Good Luck
Amir Mahfoozi 26-Sep-12 11:56am View
Add a dispatcher parameter to your extension method and pass the Dispatcher instance whenever you call this extension method.
Amir Mahfoozi 24-Jul-12 6:40am View
Hi Claudiu, does my answer at this page help you :
Amir Mahfoozi 14-Jul-12 2:59am View
Hello Clifford, That is not totally true. Because when we want to extract default template of a third party user control its only possible with Expression Blend. Also when you want to edit animations it is the Blend that helps you.
Amir Mahfoozi 14-Jul-12 2:43am View
Please provide the code that validates inputs and take the focus on invalid text box.
Amir Mahfoozi 27-Jun-12 0:47am View
How are you ?
Amir Mahfoozi 25-Jun-12 4:17am View
You're welcome.
Amir Mahfoozi 25-Jun-12 3:53am View
I have updated my answer in a new solution please accept the second one as an answer. Thanks.
Amir Mahfoozi 25-Jun-12 3:28am View
You're welcome.
Amir Mahfoozi 25-Jun-12 3:23am View
Amir Mahfoozi 24-Jun-12 3:38am View
You're welcome.
Yes there are a lot of ways to achieve this :)
Good Luck.
Amir Mahfoozi 15-Apr-12 8:13am View
Reason for my vote of 3
not working in WPF
Amir Mahfoozi 27-Mar-12 7:25am View
No problem ;)
Amir Mahfoozi 27-Mar-12 7:23am View
It was not my question :)
Amir Mahfoozi 27-Mar-12 7:18am View
+5 I tested it here : and it seems that it works well.
Amir Mahfoozi 27-Mar-12 6:46am View
Are you sure that it can be implemented with regular expressions ?
Amir Mahfoozi 27-Mar-12 6:28am View
Please elaborate on this question because it is not clear what do you mean by saying "last inserted". Is the Date field formatted so that it doesn't show the time part or maybe it is of "Date" data type. So How should we find out what is the last inserted field ?
Amir Mahfoozi 27-Mar-12 6:11am View
Amir Mahfoozi 27-Mar-12 6:00am View
Amir Mahfoozi 27-Mar-12 5:52am View
Use Google and you will find a lot of solutions.
Amir Mahfoozi 27-Mar-12 5:22am View
Amir Mahfoozi 27-Mar-12 5:12am View
Please provide the code.
Amir Mahfoozi 27-Mar-12 3:47am View
Amir Mahfoozi 27-Mar-12 3:34am View
In which line you get the error and what is the error details ?
Amir Mahfoozi 27-Mar-12 2:43am View
Your first query is ambiguous.
Amir Mahfoozi 5-Mar-12 23:41pm View
Thanks Bjorn :)
Amir Mahfoozi 17-Feb-12 23:36pm View
You're welcome. :)
Amir Mahfoozi 13-Feb-12 6:13am View
Have you used third party components ? They should caused that to happen.
Amir Mahfoozi 12-Feb-12 2:16am View
Amir Mahfoozi 12-Feb-12 2:15am View
Thank you.
Amir Mahfoozi 8-Feb-12 0:18am View
What error it gives at "dc.SubmitChanges()" in second case ?
Amir Mahfoozi 7-Feb-12 3:42am View
ASP.NET ? WPF ? Winforms ?
Amir Mahfoozi 7-Feb-12 3:38am View
You're welcome :)
Amir Mahfoozi 7-Feb-12 1:45am View
What have you done so far? Please provide your SQL statement.
Amir Mahfoozi 7-Feb-12 1:39am View
Your question is not clear. Give an example.
Amir Mahfoozi 6-Feb-12 2:20am View
+5 comprehensive answer.
Amir Mahfoozi 6-Feb-12 2:19am View
Yes I see. :)
Amir Mahfoozi 6-Feb-12 2:13am View
Yes I know. In page two of that article we see this :
After two years, Borland and Microsoft have settled their lawsuit. In a joint statement, Borland and Microsoft said, "We believe this settlement is in the best interest of both our companies. This settlement resolves any legal questions surrounding the lawsuit and allows both companies to move forward." With that short statement, both companies have agreed to make no further comments on the settlement. Details of the settlement were confidential. So this suit was eventually settled; by that time, however, Microsoft had put Hejlsberg to work.
And in Page three :
In exchange for a desperately needed $125 million cash infusion, Borland gave Microsoft the blueprints for much of its key technology, let Microsoft off the hook by settling long-standing patent disputes, and agreed to tie its own tools even more tightly to the Windows operating system. Inprise agreed to provide full access to more than 100 of its technology patents, including spreadsheet technologies and pending patent applications related to newer products. This transaction signified final victory for Microsoft in an epic battle to control the desktop database and development tool businesses.
Maybe there is another suitable word for this action, like "Business" :)
Amir Mahfoozi 6-Feb-12 1:55am View
I have upvoted it.
I read your history in your website. I believe that those times were very glorious days for Pascal and Delphi.
Read this article it confirms your "back to civilization" term :
Also it has mentioned some conspiracy theories that is better name it betraying to Delphi supporters ! :-&
Amir Mahfoozi 6-Feb-12 1:41am View
Thanks Sergey :)
Amir Mahfoozi 6-Feb-12 1:39am View
+5 I always support and welcome non MS solutions specially this one which was my favorite language(Pascal).
Amir Mahfoozi 6-Feb-12 1:37am View
Thanks Sergey :)
Amir Mahfoozi 6-Feb-12 1:33am View
Amir Mahfoozi 6-Feb-12 1:32am View
No, but I wish you get to success in this way :)
Amir Mahfoozi 6-Feb-12 1:27am View
Have a good research ;)
Amir Mahfoozi 6-Feb-12 1:25am View
If cross platform is your main consideration you should choose your development platform carefully.
Also maybe the storage you need on the Pen Drive is so simple that you just need to store them on a binary file and there was no need to add a database engine overhead to your application. So think flexible about every thing and don't bind yourself to Brands or Names.
Amir Mahfoozi 6-Feb-12 0:54am View
If you add finish conditions to it then it will work well and If you don't consider adding end conditions it will never work. No need for any special keyword.
Amir Mahfoozi 5-Feb-12 23:59pm View
I said that because I saw different approaches for loading images in resources in WPF and ASP.NET. Anyway thanks for your consideration Sergey :)
Amir Mahfoozi 5-Feb-12 7:05am View
+1000 if it was possible. The article was fantastic :o
Amir Mahfoozi 5-Feb-12 5:33am View
Maintain application layers and create two separate projects one for command line(console application) and one for UI. What is the relation of this matter with source control and other software?
Amir Mahfoozi 5-Feb-12 5:27am View
The answer depends on the application type. ASP.NET ? WPF ? Windows Forms ?
Amir Mahfoozi 5-Feb-12 5:12am View
It is not a question.
Amir Mahfoozi 5-Feb-12 4:51am View
You have asked 3 same questions. delete the extra ones please.
Amir Mahfoozi 4-Feb-12 9:47am View
It seems that it is a serious problem that you ask it in many places :
Amir Mahfoozi 4-Feb-12 4:12am View
Amir Mahfoozi 4-Feb-12 4:11am View
Thanks thatraja :)
Amir Mahfoozi 4-Feb-12 4:10am View
Amir Mahfoozi 4-Feb-12 1:39am View
Which table ? in which platform ?
Amir Mahfoozi 4-Feb-12 0:59am View
Change float to double and it produces what you wished :)
Amir Mahfoozi 4-Feb-12 0:24am View
Amir Mahfoozi 4-Feb-12 0:15am View
Your question is not clear. "abc" is the key and "xyz" is the value or "def" is the value ?
Amir Mahfoozi 2-Feb-12 7:21am View
Please express more.
Amir Mahfoozi 2-Feb-12 5:45am View
Amir Mahfoozi 2-Feb-12 5:40am View
Your question is unclear. Please provide an example.
Amir Mahfoozi 2-Feb-12 3:32am View
Amir Mahfoozi 2-Feb-12 3:31am View
Thanks a lot Thatraja :)
Amir Mahfoozi 2-Feb-12 3:30am View
You're welcome brother :)
Amir Mahfoozi 1-Feb-12 10:05am View
+5 It works CPallini :)
Amir Mahfoozi 1-Feb-12 9:51am View
Amir Mahfoozi 1-Feb-12 8:56am View
No problem Manfred :) Thanks for the 5 :)
Amir Mahfoozi 1-Feb-12 8:41am View
Amir Mahfoozi 1-Feb-12 8:41am View
Thanks for the information :)
Amir Mahfoozi 1-Feb-12 8:16am View
You're welcome.
Amir Mahfoozi 1-Feb-12 7:30am View
WPF ? ASP.NET ? or what ?
Amir Mahfoozi 1-Feb-12 7:28am View
Width and Height of which item are 100% ? Please provide code.
Amir Mahfoozi 1-Feb-12 7:16am View
Is this a part of conversation between you and someone else ? :o
Amir Mahfoozi 1-Feb-12 4:45am View
That is for C multiline comments syntax, I think.
Amir Mahfoozi 1-Feb-12 3:49am View
Dear Mehdi,
As I understood Predicates they are anonymous functions so I think your question is like asking whether I can see the condition of if statements in a method or not (at runtime) ?
Amir Mahfoozi 1-Feb-12 3:37am View
WPF ? ASP.NET ? WinForm ?
Amir Mahfoozi 1-Feb-12 3:28am View
Since most OPs forget that we have answered to them its a good idea to take care about the good answers.
Amir Mahfoozi 1-Feb-12 3:13am View
Search the internet. There are many samples out there.
Amir Mahfoozi 1-Feb-12 3:10am View
I didn't pay attention to the dates because it was on top of your answers. 6th place actually now.
Amir Mahfoozi 1-Feb-12 3:03am View
Amir Mahfoozi 1-Feb-12 3:03am View
Amir Mahfoozi 1-Feb-12 2:27am View
You're welcome.
Amir Mahfoozi 1-Feb-12 1:26am View
"move this table to a secondary file"
What do you mean ?
Amir Mahfoozi 30-Jan-12 6:43am View
Read here :
If didn't help then use Google to find more resources.
Amir Mahfoozi 30-Jan-12 6:06am View
You're welcome.
Amir Mahfoozi 30-Jan-12 5:47am View
Amir Mahfoozi 30-Jan-12 5:23am View
You will not work with ProcessExtension directly so place it in separate file then convert third code snippet to a function and manipulate it so that it can be used for both WINWORD and EXCEL. Good Luck.
Amir Mahfoozi 30-Jan-12 4:46am View
If you know where the gpio.h is located then change #include <linux/gpio.h> to #include "gpio.h" and use -I [gpio.h path] when calling make.
Amir Mahfoozi 30-Jan-12 3:34am View
+5 Good links.
Amir Mahfoozi 30-Jan-12 3:33am View
+5 It was interesting.
Amir Mahfoozi 30-Jan-12 1:36am View
Amir Mahfoozi 30-Jan-12 1:22am View
OK SA :)
Amir Mahfoozi 30-Jan-12 0:08am View
Not a question
Amir Mahfoozi 29-Jan-12 23:51pm View
This may help you :
Amir Mahfoozi 29-Jan-12 23:36pm View
Amir Mahfoozi 29-Jan-12 23:35pm View
Thanks Espen.
Amir Mahfoozi 29-Jan-12 13:30pm View
Amir Mahfoozi 29-Jan-12 13:26pm View
Thanks thatraja :)
Amir Mahfoozi 29-Jan-12 10:11am View
Thanks thatraja :)
Amir Mahfoozi 29-Jan-12 9:56am View
Amir Mahfoozi 29-Jan-12 9:55am View
It seems that you don't have the default document in root folder and you just write the address of the site and not specify which document to be opened.
Amir Mahfoozi 29-Jan-12 8:39am View
What do you mean by saying image clarity ?
Amir Mahfoozi 29-Jan-12 8:05am View
Amir Mahfoozi 29-Jan-12 8:03am View
Amir Mahfoozi 29-Jan-12 7:54am View
You can do it with both regex and HTML agility pack. The above code will do what you have mentioned here. But if you guess that there may be some syntactically incorrect occurrences then it needs some modification. But if not it solves your problem, I think.
Amir Mahfoozi 29-Jan-12 7:45am View
I didn't invented it ;) I just copy and paste it from stakoverflow. But the whole code is mine :)
This person has described it to some extents :
BTW, I feel that HTML Agility Pack will solve your problem :
Give it a try when you had time.
Amir Mahfoozi 29-Jan-12 7:32am View
You are completely right and a sort operation never ever reaches to the efficiency of a simple pass through NxN elements. ;) so I remove this answer :-&
Amir Mahfoozi 29-Jan-12 7:30am View
Hi Andreas, Of course you are right but I mentioned he may do some customizations to remove the data exchanges parts of a sort algorithm.
Thanks for your consideration.
Amir Mahfoozi 29-Jan-12 6:45am View
Your question is not clear. Please specify platform and also provide more details.
Amir Mahfoozi 29-Jan-12 6:42am View
Dear _q12_. Are you telling this to me or SA ? if SA then you have mistakenly replied to my comment. BTW, I think that your problem can be solved by using xml loaders :)
Amir Mahfoozi 29-Jan-12 4:27am View
Amir Mahfoozi 29-Jan-12 4:26am View
Amir Mahfoozi 29-Jan-12 4:25am View
Thanks a lot :)
Amir Mahfoozi 29-Jan-12 4:25am View
Thanks Abhinav :)
Amir Mahfoozi 29-Jan-12 4:17am View
Amir Mahfoozi 29-Jan-12 4:15am View
Thanks Abhinav :)
Amir Mahfoozi 29-Jan-12 3:51am View
+5 good point. He can use user input as the element index. :) that means the whole search is just an access to an array by index.
Amir Mahfoozi 29-Jan-12 3:45am View
Amir Mahfoozi 29-Jan-12 3:44am View
"What is that? Who is owner?" I like your sense of humor ! :)
Amir Mahfoozi 29-Jan-12 3:43am View
"I'm not a prologer but I like prologers" !
Have a look at these pages, may it give you some inspiration:
Amir Mahfoozi 29-Jan-12 3:32am View
What do you mean by easy and difficult ?
Amir Mahfoozi 29-Jan-12 3:29am View
+5 nice link.
Amir Mahfoozi 29-Jan-12 3:27am View
Thanks Abhinav. :)
Amir Mahfoozi 29-Jan-12 3:19am View
It is just two nested loops, so try to implement it and if you get errors mention it here.
Amir Mahfoozi 29-Jan-12 3:06am View
Amir Mahfoozi 29-Jan-12 3:05am View
Thanks Abhinav.
Amir Mahfoozi 29-Jan-12 3:05am View
Amir Mahfoozi 29-Jan-12 3:04am View
Are they ASP.NET files ?
Amir Mahfoozi 29-Jan-12 2:53am View
Amir Mahfoozi 29-Jan-12 1:50am View
The code seems well. Please specify whether it passes all "If"s or not. If not, it fails in which "If"? and what is the error details?
And generally make sure that ftp upload can be done with a third party application to ensure that no firewall will prevent this operation then focus on this application.
Amir Mahfoozi 29-Jan-12 0:22am View
Amir Mahfoozi 29-Jan-12 0:22am View
Amir Mahfoozi 29-Jan-12 0:20am View
Amir Mahfoozi 29-Jan-12 0:16am View
Yes it is somehow as revolutionary as TV and Telephone. I think we will see it in our daily life as soon as its production reaches to a reasonable price.
Amir Mahfoozi 29-Jan-12 0:13am View
Amir Mahfoozi 29-Jan-12 0:12am View
Amir Mahfoozi 29-Jan-12 0:06am View
+5 Interesting links. :)
Amir Mahfoozi 29-Jan-12 0:05am View
Thanks a lot :)
Amir Mahfoozi 29-Jan-12 0:05am View
Thanks a lot :)
Amir Mahfoozi 29-Jan-12 0:04am View
Amir Mahfoozi 29-Jan-12 0:04am View
Thank you SA :)
Amir Mahfoozi 29-Jan-12 0:03am View
Thank you Bill :)
Amir Mahfoozi 29-Jan-12 0:01am View
Thanks SA :)

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