Click here to Skip to main content
15,220,129 members

Comments by Sanjay K. Gupta (Top 155 by date)

Sanjay K. Gupta 3-Jul-20 7:26am View
His answer did not contains sub query, it was derived table. Please update your vote.
Sanjay K. Gupta 19-Apr-18 3:35am View
It should work.
Sanjay K. Gupta 19-Apr-18 3:32am View
What is type of "val"? If it other that float then convert it to first in float using parseFloat method.
Sanjay K. Gupta 20-Jan-17 2:51am View
you tried Enter event. What error you get?
Sanjay K. Gupta 5-Feb-16 7:38am View
Upload "Oracle.ManagedDataAccess.dll" in "bin" folder
Sanjay K. Gupta 28-Dec-15 0:10am View
It is pretty simple.

sbNews.Append("Click here to view more");
Sanjay K. Gupta 24-Dec-15 0:03am View
Your question is not clear and seems it is a home work type question.
I think you are in wrong field. You should try to build your career in other field instead of Programming. Best of luck!
Sanjay K. Gupta 24-Jul-15 1:46am View
Reason for my vote of 5 \n Awesome!
Sanjay K. Gupta 13-Jul-15 7:58am View
You have given the solution without knowing the error. Brilliant! +5
Sanjay K. Gupta 5-Sep-14 1:18am View
Reason for my vote of 5 \n Great use of AngularJS and canvas!
Sanjay K. Gupta 1-Sep-14 0:49am View
Reason for my vote of 5 \n Great Tip. Have a 5!
Sanjay K. Gupta 28-Aug-14 8:22am View
Where you guys learned, passing parameters to the query in this way. Total disgusting. Please tell me the tutor name. :)
Sanjay K. Gupta 28-Aug-14 5:13am View
Rebulid your solution!!!
Sanjay K. Gupta 2-Jul-14 0:25am View
You can post this as a solution not as a comment.
Sanjay K. Gupta 28-Jun-14 2:33am View
I am sure, you are rebinding the grid on every postback. Can you post your codes.
Sanjay K. Gupta 28-Jun-14 2:30am View
Do you want the mail should sent automatically?
Sanjay K. Gupta 28-Jun-14 2:30am View
The question is not clear. I think, he was talking about automated mail sending.
Sanjay K. Gupta 28-Jun-14 2:26am View
Instead of laughing on his naming convention, you should provide a solution for his problem.:)

Sanjay K. Gupta 19-Jun-14 3:46am View
OK. three lines code and four times editing. :)
Sanjay K. Gupta 19-Jun-14 3:42am View
I am expecting you to do not repeat the same mistakes in future. If I will improve then probably you do the same thing again. Just like, you have improved your solution of first line only rest of two lines still wrong. :) Correct it.
Sanjay K. Gupta 19-Jun-14 3:38am View
My friend, C# is a case sensitive language. So take care.
Sanjay K. Gupta 19-Jun-14 3:25am View
Sanjay K. Gupta 3-Jun-14 8:59am View
No. He is expert. ;)
Sanjay K. Gupta 3-Jun-14 8:54am View
OK. I think, you assume that the OP had asked somewhere else (some expert people) "How to visit Code Project". :)
Sanjay K. Gupta 3-Jun-14 8:51am View
OK. I think, you assume that "Google" is blocked to OP.
Sanjay K. Gupta 3-Jun-14 8:44am View
Same way you learn how to ask questions at Code Project. :)
Sanjay K. Gupta 27-May-14 2:22am View
Good question :)

Please ask here(
Sanjay K. Gupta 27-May-14 2:20am View
What error you are facing?
Sanjay K. Gupta 26-May-14 8:50am View
Please do not use sms/chat language.
Sanjay K. Gupta 23-May-14 8:08am View
Please correct the syntax.
Sanjay K. Gupta 22-May-14 0:50am View
Then please Improve your solution so that OP can accept your answer and may be helpful to others in future.
Sanjay K. Gupta 22-May-14 0:47am View
The code is fine but add condition for getting selected list items only. If it is a window app then there is a property called "SelectedItems".
Sanjay K. Gupta 19-May-14 8:45am View
dt.Rows[0]["GraceTime"] will return System.Object. You need to first convert it to DateTime object.

Try this
txtGrace.Text =Convert.ToDateTime(dt.Rows[0]["GraceTime"]).ToString("hh:mm tt");
Sanjay K. Gupta 19-May-14 8:44am View
dt.Rows[0]["GraceTime"] will return System.Object. You need to first convert it to DateTime object.

Try this
txtGrace.Text =Convert.ToDateTime(dt.Rows[0]["GraceTime"]).ToString("hh:mm tt");
Sanjay K. Gupta 2-May-14 3:28am View
Your question is not clear. SQL 2000 is not a Code Conversion software.
Sanjay K. Gupta 2-May-14 3:27am View
Please add code, I am waiting. Also upload the codes of Page_Load and Page_init if you have.
Sanjay K. Gupta 2-May-14 3:25am View
Please store data in database, at least in Access or you can prefer NOSQL approach also. Storing data in database would be good for long running. After storing the data in database, you can simply create a report and export it in any format like .csv, excel or .pdf.
Sanjay K. Gupta 2-May-14 3:21am View
I am not getting your problem. Have you facing any error during execution?
Sanjay K. Gupta 2-May-14 3:18am View
What you have done so far?
Sanjay K. Gupta 25-Apr-14 9:59am View
take span or make display:inline;
Sanjay K. Gupta 3-Apr-14 5:57am View
check again, I have updated the code.
Sanjay K. Gupta 3-Apr-14 4:57am View
You can use below code for credential
using ( new Impersonator( "myUsername", "myDomainname", "myPassword" ) )
// code that executes under the new context.
File.Copy( x, y );
Sanjay K. Gupta 3-Apr-14 4:55am View
It will simply throw exception and that need to be handled.
Sanjay K. Gupta 3-Apr-14 4:48am View
You can insert a blank item at position 0
Sanjay K. Gupta 4-Jan-14 3:53am View
PageMethods are not visible in intellisense, But you can call as PageMethods.yourMethodName
Sanjay K. Gupta 4-Jan-14 0:37am View
Your method must be public and static
Sanjay K. Gupta 2-Aug-13 5:02am View
What you have tried?
Where you heve stucked?
What error you are getting?
Sanjay K. Gupta 18-Jul-13 9:20am View
Reason for my vote of 5 \n Thanks for sharing
Sanjay K. Gupta 17-Jul-13 0:58am View
Reason for my vote of 4 \n One Suggestion: Put proper variable names in your code.
Sanjay K. Gupta 16-Jul-13 7:11am View
Have you checked "AutoPostBack" property of Dropdownlist. It should "True"
Sanjay K. Gupta 15-Jul-13 2:01am View
Your Database name is "CompanyName" or Table name is "CompanyName"????
Sanjay K. Gupta 2-Jul-13 10:01am View
Reason for my vote of 5 \n Nice Effort!
Sanjay K. Gupta 29-Jun-13 7:10am View
Reason for my vote of 5 \n Nice Effort
Sanjay K. Gupta 25-Jun-13 2:41am View
You cannot have Datagridview in ASP.NET
Sanjay K. Gupta 18-Apr-13 12:37pm View
window.onload = CallMe;

you are calling PageMethod at page load
Sanjay K. Gupta 18-Apr-13 8:48am View
You are calling page method at page load. Why cannot you bind the Country dropdown at server side. After binding the Country, when user select country, bind State DropdownList by PageMethod.
Sanjay K. Gupta 19-Mar-13 8:14am View
Try to download in chrome
Sanjay K. Gupta 8-Mar-13 8:45am View
What about missing semicolons.
Sanjay K. Gupta 4-Mar-13 6:56am View
For Charts and Graphs, you can use Microsoft Reporting Controls.
Sanjay K. Gupta 4-Mar-13 3:39am View
please attach/share screen shot of your chart
Sanjay K. Gupta 2-Mar-13 6:48am View
You have added an extra 'if' before 'alert'.
Sanjay K. Gupta 5-Feb-13 9:15am View
I am giving you a question to test your programming skill. Write C# code for calculating below scenario.

1. Potato 5 Rs/Kgs
2. Onion 1 Rs/Kgs
3. Palak 0.25/Kgs

write a program to buy all vegetables 5 Kgs in 5 Rs.
Sanjay K. Gupta 5-Feb-13 2:17am View
add break point at
and see the file.FullName value
Sanjay K. Gupta 8-Jan-13 5:04am View
The database stored image path or image(in byte) itself
Sanjay K. Gupta 8-Jan-13 5:02am View
Check only image path, not the image
Sanjay K. Gupta 2-Jan-13 8:37am View
Nice Solution
Sanjay K. Gupta 2-Jan-13 8:11am View
Reason :- value of "comboBox2.SelectedValue.ToString()" is non-numeric.
Rest is up to you.
Sanjay K. Gupta 26-Dec-12 7:42am View
1. Read about SQL Injection.
2. You have written MsgBox("Success") in Finally Block. Finally Block will always execute even it throws error.
Sanjay K. Gupta 26-Dec-12 7:40am View
Read about SQL Injection.
Sanjay K. Gupta 26-Dec-12 7:36am View
Hi Deenuji,
Please tell me who has taught you to pass SQL Parameters like this way???
I am searching for the person (or the source). Please.
Sanjay K. Gupta 24-Dec-12 0:05am View
You have to hack the key down event in javascript.
Sanjay K. Gupta 24-Dec-12 0:03am View
Why you need key logger??
Sanjay K. Gupta 24-Dec-12 0:03am View
Sanjay K. Gupta 17-Dec-12 6:53am View
Hi ravuravu,
Please tell me who has taught you to pass SQL Parameters like this way???
I am searching for the person (or any source). Please.
Sanjay K. Gupta 6-Dec-12 1:18am View
What you have tried so for?
Sanjay K. Gupta 19-Nov-12 23:50pm View
I think you have added web.config file in your any sub directory (multiple web.config in an application). For running these type of application, you have to create sub domain in your application.
Sanjay K. Gupta 19-Nov-12 23:46pm View
Yes it allows to download. Me too tried.
Sanjay K. Gupta 19-Nov-12 23:45pm View
Just hyperlink to the above down-able ULRs using anchor tag in html. I think may it solve your problem. You are using ASP.NET (web based application).
Why you need extra stuff like "WebClient"??
Sanjay K. Gupta 19-Nov-12 23:38pm View
1. Are you using SQL Server? if not then please mention the Database
2. In which line you are getting NULL Exception?
Sanjay K. Gupta 16-Nov-12 5:57am View
Yes you are right but OP need some "Replace" related help. Your solution is simple and best.
Sanjay K. Gupta 16-Nov-12 5:55am View
+5 from me.
Nice solution.
Sanjay K. Gupta 16-Nov-12 5:33am View
right click on the page in "Solution Explorer" and click on "Convert to Web Application". May be the designer file not generated.
Sanjay K. Gupta 12-Nov-12 6:46am View
No Idea.
Sanjay K. Gupta 12-Nov-12 5:24am View
Be Specific about your question.
Sanjay K. Gupta 12-Nov-12 5:23am View
Are you talking about ASP.NET?
Sanjay K. Gupta 12-Nov-12 5:13am View
+5 , I think it will work.
Sanjay K. Gupta 12-Nov-12 5:11am View
What error you have faced and in which line?
Sanjay K. Gupta 12-Nov-12 5:10am View
At-least tell us, what you have tried yet.
Sanjay K. Gupta 12-Nov-12 5:05am View
Please elaborate clearly what you are asking for.
Sanjay K. Gupta 12-Nov-12 4:59am View
InfoMessage event only fires when a client message is sent by SQL Server during/after sql query execution.
Sanjay K. Gupta 12-Nov-12 4:34am View
1. Add new formula
2. Concat the all fields
Hope it will helpul to you.
Sanjay K. Gupta 12-Nov-12 4:29am View
y? Is this the way.....
Sanjay K. Gupta 9-Nov-12 0:16am View
What is your date format?
Sanjay K. Gupta 8-Nov-12 8:37am View
Is this a best way?
Sanjay K. Gupta 8-Nov-12 1:56am View
Call your method in Row_Created when Header is being created
Sanjay K. Gupta 7-Nov-12 2:23am View
Find your answer from google.
Sanjay K. Gupta 7-Nov-12 2:23am View
Have you written the Response.Redirect method after showing the alert?
Sanjay K. Gupta 7-Nov-12 2:19am View
Use CalendarExtender of Ajax. you can give the format as you want. You can also separate the Date and Time Values
Sanjay K. Gupta 7-Nov-12 2:18am View
Need more explanation. Please put your data, so that we may give you suggestions
Sanjay K. Gupta 7-Nov-12 0:17am View
store this way value in session
I thing you are storing the "DataRowView" object in session.
Sanjay K. Gupta 7-Nov-12 0:14am View
You are missing '#' in jquery selector.
Sanjay K. Gupta 6-Nov-12 9:15am View
Do your assignments yourself. Better luck next time.
Sanjay K. Gupta 6-Nov-12 4:32am View
But why you need both table and label
Sanjay K. Gupta 5-Nov-12 8:19am View
Simply, Rebind the your GridView after saving the data.
Sanjay K. Gupta 5-Nov-12 8:16am View
I think, it is not possible. You have to add a child table for holding the foreign-primary relation.
Sanjay K. Gupta 3-Nov-12 1:27am View
Are you want to prevent back date entry for saving?
Sanjay K. Gupta 1-Nov-12 10:13am View
You have eaten my whole day rep points.No Problem.
Have a nice evening. GB.
Sanjay K. Gupta 1-Nov-12 10:12am View
You eat my whole day point. No problem.
Sanjay K. Gupta 1-Nov-12 10:08am View
KeyPressEventArgs object of win application. OP has question as "how to add two textbox value on textbox keypress event in web application?". You are more senior than me. I am not arguing with you. Dont dont downvote me.
Sanjay K. Gupta 1-Nov-12 10:08am View
KeyPressEventArgs object of win application.
OP has question as "how to add two textbox value on textbox keypress event in web application?".
You are more senior than me. I am not arguing with you. Dont dont downvote me.
Sanjay K. Gupta 1-Nov-12 10:00am View
It is enough.
Sanjay K. Gupta 1-Nov-12 9:59am View
Sanjay K. Gupta 1-Nov-12 9:55am View
He has specified the Tag.
Sanjay K. Gupta 1-Nov-12 9:55am View
He has specified the Tag
Sanjay K. Gupta 1-Nov-12 8:43am View
The solution may asked for ASP.NET. Your code shows C#.NET window application.
Sanjay K. Gupta 1-Nov-12 8:40am View
Use Identity for next auto numbering.
For getting the deleted id you can try
select count(id)+1
But it may not be unique.
Sanjay K. Gupta 1-Nov-12 8:36am View
As per OriginalGriff, the first day of week may differ from culture to culture.
You can try below solution.
Sanjay K. Gupta 1-Nov-12 8:31am View
dt.DefaultView.Sort = "EmpID,EmpName Desc";//dt is your datable instance
Sanjay K. Gupta 1-Nov-12 8:20am View
your update command is wrong. correct may be
string updateSql1 = "UPDATE txfile " + "SET expiry_dt=DateAdd(dd,180,getdate())";
Sanjay K. Gupta 1-Nov-12 8:10am View
Yes, you are right.
may be the solution
(dt.Day + ((int)dt.DayOfWeek)) / 7 + 1
Sanjay K. Gupta 22-Oct-12 3:24am View
Please elaborate clearly.
Sanjay K. Gupta 22-Oct-12 3:23am View
Before calling the 'DeleteLateAttendance()" function, bind the Grid
Sanjay K. Gupta 20-Oct-12 9:07am View
Page_Load nothing but a function.
Call it as a function
Sanjay K. Gupta 20-Oct-12 9:06am View
you can call also as

Sanjay K. Gupta 19-Oct-12 8:12am View
I question to inderkalia: How many errors may come in above code?
Sanjay K. Gupta 17-Sep-12 4:36am View
Reason for my vote of 5
Sanjay K. Gupta 31-Aug-12 9:26am View
Sanjay K. Gupta 31-Aug-12 1:23am View
Data of Birth?
Sanjay K. Gupta 16-Jun-12 8:52am View
Reason for my vote of 5
I impresed
Sanjay K. Gupta 2-Jun-12 0:34am View
Reason for my vote of 4
Nice One
Sanjay K. Gupta 9-May-12 4:36am View
Reason for my vote of 1
Sanjay K. Gupta 24-Feb-12 0:30am View
Thanks Sachin
Sanjay K. Gupta 17-Feb-12 2:17am View
see web.confing->appSettings key
Sanjay K. Gupta 16-Feb-12 9:02am View
Hi rockpune!
You are software developer and you dont know how to ask a Question. Very Bad!
Please read/learn more about .NET. Please learn English also.
Best of Luck!
Sanjay K. Gupta 10-Feb-12 5:36am View
Is this the way of updating a record in database.
Please learn it!
Sanjay K. Gupta 10-Feb-12 5:35am View
Hi shweta9999,
Please accept the answer. A P Indore have given you right code.
Sanjay K. Gupta 10-Feb-12 5:31am View
Please accept the answer if it helped you!
Sanjay K. Gupta 10-Feb-12 5:31am View
<div style="height:400px;width:600px;overflow:scroll;">
Put your image here!
Sanjay K. Gupta 9-Feb-12 2:28am View
because the answer is given by "thatraja".
Sanjay K. Gupta 8-Feb-12 8:30am View
Take 5!
Very Good Link.
Sanjay K. Gupta 8-Feb-12 6:56am View
My 1!
If you are giving any suggestion, put it in comment not in "Solution"
Sanjay K. Gupta 8-Feb-12 6:55am View
See the Tag!!!!!!!!!!!
Sanjay K. Gupta 8-Feb-12 1:20am View
Hi Beena,
you have just denied my answers. but OK.

If you want to create dll for google transliterate api, Learn from net and do it yourself instead of searching and asking.
Sanjay K. Gupta 7-Feb-12 1:22am View
Agreed! Sachin.
Thanks for giving your solution.
Take 5! from me.
Sanjay K. Gupta 6-Feb-12 2:56am View
What this means
Actual name:REKHA MEHTA
Given result in excel:REKHA MEHTA
Sanjay K. Gupta 3-Feb-12 3:45am View
I agree with you .
5 Take from me
Sanjay K. Gupta 3-Feb-12 2:05am View
My blog is
Sanjay K. Gupta 1-Feb-12 23:28pm View
Please send the code of App.config file
Sanjay K. Gupta 1-Feb-12 7:12am View
First try it yourself. Learn more about it on the net. If you get any discrepancy, then post here.

Best of Luck!
Sanjay K. Gupta 1-Feb-12 5:43am View
Sanjay K. Gupta 31-Jan-12 23:22pm View
In which line you are getting error.
1. tot.innerHTML = "$" + totValueRound.toFixed(2);
2. grid.rows[grid.rows.length - 1].cells[2].children[0].innerHTML = "$" + grandTotal.toFixed(2);
3. document.getElementById('lblTotal').innerHTML = percentTotal.toFixed(2);

Put your markup code (if possible).
Sanjay K. Gupta 31-Jan-12 7:18am View
What error you are facing, mention about it.
Sanjay K. Gupta 30-Jan-12 8:23am View
Then why you have mention the Tag of question Under ASP.NET
Sanjay K. Gupta 30-Jan-12 7:28am View
First try yourself and give the problem details,if you faced.
Sanjay K. Gupta 20-Jan-12 8:14am View
What do you want to print C# Function or Any Control or Whole Page