16,004,653 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by xpertzgurtej (Top 78 by date)
xpertzgurtej
20-Nov-18 3:54am
View
ok..thanks
xpertzgurtej
19-Nov-18 6:40am
View
i am using asp.net and sql server. Thanks for giving the idea to solve my issue..many many thanks to you..
xpertzgurtej
19-Nov-18 6:36am
View
Sorry for reposting..i thought my question title was bit confusing and no one answered for long time so i posted another question with clear title..
xpertzgurtej
23-Aug-18 8:46am
View
My query is not solved when I tested with different cases
xpertzgurtej
23-Aug-18 3:51am
View
Dates is not stored as string..It is stored as date. single quotes is used to insert date in datetime column
xpertzgurtej
23-Aug-18 3:49am
View
Deleted
I have resolved my problem using:
SELECT * FROM @tb WHERE EmployeeId=@EmployeeId AND ((@StartDate BETWEEN LeaveFromDate AND LeaveToDate) OR (@EndDate BETWEEN LeaveFromDate AND LeaveToDate))
xpertzgurtej
23-Aug-18 1:18am
View
thanks.. It worked as required..
xpertzgurtej
22-May-18 23:59pm
View
did not work..got error : Invalid object name '#tbEmp'
xpertzgurtej
22-May-18 23:59pm
View
Deleted
.
xpertzgurtej
5-May-18 8:41am
View
separator is not fixed. So i cant use {'$'}
xpertzgurtej
5-May-18 8:31am
View
I found the solution:
string str = "12$$34$$45";
string separator = "$$";
string[] partsFromString = str.Split(new string[] { separator }, StringSplitOptions.None);
xpertzgurtej
5-May-18 8:06am
View
with single $ it works. but for :
string str = "12$$34$$45";
string [] result= Regex.Split(str, @"\$$");
it doesn't work. How to handle this?
Actually i want to split my string and separator may be of multiple characters.
e.g.:
string str = "12$$34$$45";
string separator = "$~$";
string [] result= Regex.Split(str, @"\"+ separator + "");
xpertzgurtej
24-Jan-18 0:37am
View
It worked.thanks a lot for your time :)
xpertzgurtej
23-Jan-18 4:35am
View
Can anybody help
xpertzgurtej
23-Jan-18 4:10am
View
DECLARE @tbDate TABLE(Sno INT IDENTITY(1,1), AttendanceDate DATE, USerId INT)
INSERT INTO @tbDate SELECT DISTINCT CAST(InOutDateTime AS DATE),UserId FROM @tb
DECLARE @tbDateCount INT=(SELECT COUNT(*) FROM @tbDate), @RowId INT=1
DECLARE @AttDate DATE,@UId INT,@MaxInOutTime DATETIME,@MinInOutTime DATETIME
DECLARE @FinalResult TABLE(EmployeeId INT, InTime DATETIME, OutTime DATETIME)
WHILE @RowId<=@tbDateCount
BEGIN
SELECT @AttDate=AttendanceDate , @UId=UserId FROM @tbDate WHERE Sno=@RowId
SELECT @MinInOutTime=(SELECT MIN(InOutDateTime) FROM @tb
WHERE CAST(InOutDateTime AS DATE)=@AttDate AND USerId=@UId AND ISNULL(AttendanceType,'')= CASE WHEN AttendanceType IS NOT NULL THEN 'I' ELSE '' END),
@MaxInOutTime=(SELECT MAX(InOutDateTime) FROM @tb
WHERE CAST(InOutDateTime AS DATE)=@AttDate AND USerId=@UId AND ISNULL(AttendanceType,'')= CASE WHEN AttendanceType IS NOT NULL THEN 'O' ELSE '' END)
INSERT INTO @FinalResult SELECT @UId, @MinInOutTime,@MaxInOutTime
SET @RowId=@RowId+1
END
SELECT * FROM @FinalResult
I am able to get the result what i want. But it is not optimized way. It works very slow. I want the result without looping through each record
xpertzgurtej
23-Jan-18 3:51am
View
i tried select UserId,AttendanceType, min(InOutDateTime) min_InDateTime, max(InOutDateTime) max_OutDateTime
from @tb group by UserId, CAST(InOutDateTime AS DATE),AttendanceType
having AttendanceType in ('I','O')
ORDER BY UserId, CAST(InOutDateTime AS DATE). It is giving me 6 rows instead of 3 rows
xpertzgurtej
23-Jan-18 3:39am
View
thanks for your suggestion. I tried but could not find the desired result.
xpertzgurtej
18-Jan-18 7:24am
View
No..it is not working as per ur solution:
DECLARE @tb TABLE (Id INT, Name NVARCHAR(100));
insert into @tb VALUES (1,'Aman');
insert into @tb VALUES (2,N'سانديب');
insert into @tb VALUES (3,'Anuj');
insert into @tb VALUES (4,N'فيكاس');
insert into @tb VALUES (5,N'اليت');
insert into @tb VALUES (6,'Sunil');
insert into @tb VALUES (7,'Ajay');
insert into @tb VALUES (8,N'فيشال');
insert into @tb VALUES (9,'Tarun');
DECLARE @str NVARCHAR(50)='سانديب'
DECLARE @str1 NVARCHAR(50)
SET @str1=N'' + @str
SELECT * FROM @tb WHERE Name LIKE '%'+ @str1 +'%'
no results
xpertzgurtej
18-Jan-18 4:08am
View
& cant be used for concatenation. Showing error :The data types nvarchar and nvarchar are incompatible in the '&' operator.
xpertzgurtej
13-Oct-17 7:13am
View
it worked..thanks
xpertzgurtej
13-Oct-17 3:23am
View
i already tried with OR instead of And.. OR works fine to prevent data in between existing range but not for overlapping range like 1-70 as i asked in my question
xpertzgurtej
3-Oct-17 2:51am
View
Thanks for your solution. I got idea from this example and completed my actual requirement
xpertzgurtej
4-May-17 5:20am
View
Deleted
.
xpertzgurtej
26-Apr-17 3:46am
View
Deleted
.
xpertzgurtej
7-Mar-17 5:32am
View
thanks for your suggestions. :)
xpertzgurtej
7-Mar-17 5:26am
View
i have written instruction note below password textbox. I just wanted to validate whether user has typed valid password as per rule or not.. I think in that case your regex answer will be ok. is not it?
xpertzgurtej
7-Mar-17 4:57am
View
thanks for your suggestions
xpertzgurtej
7-Mar-17 4:57am
View
its working as expected
xpertzgurtej
6-Mar-17 6:48am
View
:(
xpertzgurtej
6-Mar-17 6:20am
View
.
xpertzgurtej
6-Mar-17 5:20am
View
So what should i do now? Should i use ValidateRequest="false" at page directive or something else?
xpertzgurtej
6-Mar-17 4:34am
View
i don't want to set ValidateRequest="false" because it will allow XSS attacks. What to do in this case? how to ensure this?
xpertzgurtej
14-Feb-17 1:55am
View
yes..its working..Actually i was looking for single update statement solution. But no problem..thanks for your help
xpertzgurtej
26-Jan-17 23:36pm
View
thanks for your help..It worked same as i want..
xpertzgurtej
15-Jul-16 4:41am
View
that work when we click on checkbox but i want to fire event on checkbox item name
xpertzgurtej
23-May-16 6:03am
View
i know the use of fileupload control in this scenario but I was thinking to get this done without uploading the file. i have to go for fileupload control. thanks for your time.
xpertzgurtej
23-May-16 4:56am
View
But through file upload control, my database file of size 400 MB will first upload on server then i will be able to get the file path. I don't want to upload the file, just want to get the path.
xpertzgurtej
31-Mar-16 3:20am
View
Suppose the table has Only 3 fields . FirstName, MiddleName and LastName. And there are 1000 records and i want to delete last 10 records. Then how to delete them
xpertzgurtej
31-Dec-15 2:15am
View
I read the article mentioned by you. But not able to decide what to use. Please suggest as per my case.
xpertzgurtej
31-Dec-15 1:40am
View
But is it right to read from session 50 times? which approach is better, the one i am using as mentioned in my question or as suggested by you. I mean Reading 50 times from cookie or session? Which one is better?
Please clarify
xpertzgurtej
31-Dec-15 1:36am
View
So u mean i should store schoolid in viewstate and then i can fetch from viewstate whereevere required? But is it right to read viewstate 50 times? which approach is better, the one i am using as mentioned in my question or as suggested by you. I mean Reading 50 times from cookie or viewstate? Which one is better?
Please clarify
xpertzgurtej
15-Dec-15 2:13am
View
because my gridview has a hiddenfield Control. If i don't generate dynamic form tag then i get the error 'ctl00_ContentPlaceHolder1_gridView_ctl00_hdEmployeeid' of type 'HiddenField' must be placed inside a form tag with runat=server.
xpertzgurtej
14-Dec-15 23:19pm
View
Thanks Rajdeep. I got the idea with your help. With little modification i was able to achieve my goal..
xpertzgurtej
24-Nov-15 7:35am
View
Thanks. Its working with little modification to make it work on asp.net page..
xpertzgurtej
24-Nov-15 2:28am
View
It is yyyy-yy. Bacause i want the user to enter academic session in this format e.g. 2014-15
xpertzgurtej
24-Nov-15 2:01am
View
tried maskededitextender but no luck
xpertzgurtej
9-Nov-15 0:32am
View
finally implemented the solution suggested by you..thanks
xpertzgurtej
7-Nov-15 6:51am
View
Thanks for you suggestion.If no other solution found then i will go with your solution.
xpertzgurtej
7-Nov-15 4:09am
View
Yes that works..But i want to restrict user to enter those useless long words because they worth nothing
xpertzgurtej
15-Oct-15 7:37am
View
There wil be lots of tables, SP's in the database. And many concurrent users. Is it possible with VistaDb?
xpertzgurtej
8-Sep-15 4:53am
View
Thanks..It helped me in getting my requirement done
xpertzgurtej
1-Sep-15 7:40am
View
there is also a column AttendanceType which stores 0 for intime and 1 for outime in Table1
xpertzgurtej
1-Sep-15 7:16am
View
yes time is stored as datetime
xpertzgurtej
1-Sep-15 7:00am
View
yes there is date column in both tables
xpertzgurtej
31-Aug-15 2:19am
View
Thanks for your reply..But is there any direct running example as per my requirement?
xpertzgurtej
31-Aug-15 1:00am
View
actually i have to implement this functionality in asp.net because i am using asp.net and sql server in my project and want to import access data into my sql server table
xpertzgurtej
22-Jul-15 7:50am
View
Thanks OriginalGriff for your help..it solved my problem.
xpertzgurtej
16-Jul-15 5:00am
View
Thanks its working as per required..:)
xpertzgurtej
16-Jul-15 4:31am
View
Thanks for your reply..But my required is: 7 which will be passed in stored procedure as a parameter and i want to check whether it exists in any of the row of #MyTable or not?
xpertzgurtej
6-Jul-15 2:06am
View
thanks magic wonder your updated solution was awesome..:).. Can you please also suggest if country is also nullable then what changes are reuired?
xpertzgurtej
6-Jul-15 1:40am
View
These are database values and i want to get single concatenated field
xpertzgurtej
6-Jul-15 1:39am
View
Not workoing as required..It is displayinh -> where there are Nulls
xpertzgurtej
23-May-15 8:41am
View
.
xpertzgurtej
13-May-15 8:49am
View
.
xpertzgurtej
1-May-15 0:40am
View
Thanks for your suggestions virusstorm..Can we use Hangfire for my requirement? Does it work for Asp.Net(Not MVC).
xpertzgurtej
30-Apr-15 7:28am
View
I just want to implement those requirements and need guidance..
xpertzgurtej
23-Apr-15 1:58am
View
Deleted
.
xpertzgurtej
15-Apr-15 7:07am
View
Thanks for your valuable suggestions..your solution worked for me..I also got another solution:
namespace MyNamespace
{
public class demo1:demo2
{
public static int Myfunction1()
{
return demo2.Myfunction2(100,400);
}
}
public class demo2
{
protected static int Myfunction2(int a, int b)
{
retutn a+b;
}
}
}
This way user can't access Myfunction2
xpertzgurtej
15-Apr-15 6:54am
View
that will create complexity..still if there are no other options then it could it a nested class. How to do that?
xpertzgurtej
15-Apr-15 6:38am
View
Yes. My class structure is like that..
xpertzgurtej
15-Apr-15 6:26am
View
Both the classes are in same namespace. And user is calling them form the same project(from the front end) I want user can call Myfunction1 but not Myfunction2
xpertzgurtej
15-Apr-15 5:46am
View
making them static was my requirement..Can't change them..Please suggest a solution having them as it is..
xpertzgurtej
2-Apr-15 8:34am
View
Ok.thanks for your suggestions
xpertzgurtej
2-Apr-15 6:00am
View
I know that way..But my requirement is to get property names from the ApplicantInfo object without a separate loop..I think there must be some way to handle this..
xpertzgurtej
2-Apr-15 6:00am
View
I know that way..But my requirement is to get property names from the ApplicantInfo object without a separate loop..
xpertzgurtej
27-Mar-15 2:13am
View
thanks for the reply. But can you please provide suitable example to achieve my requirement?
xpertzgurtej
27-Mar-15 2:12am
View
thanks for the reply but i have to find all the tags wrapped in {} not just the {}. Please reply with suitable example if possible
xpertzgurtej
23-Dec-14 7:37am
View
Deleted
.
Show More