16,004,507 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 M Imran Ansari (Top 110 by date)
M Imran Ansari
23-Jan-24 0:29am
View
Sure, proceed with a dynamic query, as also indicated in the comments of solution-1. Kindly check out the provided link for more information on 'Building Dynamic SQL' https://www.codeproject.com/Articles/20815/Building-Dynamic-SQL-In-a-Stored-Procedure
M Imran Ansari
9-Jan-24 18:57pm
View
Thank you.
M Imran Ansari
8-Jan-24 4:54am
View
We only concern about the article contents instead of any other services. I don't think If the contents are self explanatory with good examples we shouldn't consider it.
M Imran Ansari
8-Jan-24 4:51am
View
How?
M Imran Ansari
7-Jan-24 12:55pm
View
You're welcomed! Happy to assist. :)
M Imran Ansari
29-Dec-23 11:55am
View
Oops! Thank you for the clarification.
M Imran Ansari
18-Dec-23 18:15pm
View
The issue seems to be related to the use of a nullable int? id in the GetById method. The Find method of DbContext does not accept nullable types for the key parameter. You need to ensure that you are passing a non-null value to the Find method.
You can modify your GetById method to handle the nullable id by converting it to a non-nullable int before passing it to the Find method. Here's an updated version of your GetById method:
public T GetById(int? id)
{
try
{
if (id.HasValue)
{
return LapShopContext.Set<t>().Find(id.Value);
}
else
{
return null;
}
}
catch (Exception)
{
return null;
}
}
M Imran Ansari
12-Dec-23 12:49pm
View
You're Welcome! We are glad to hear that.
M Imran Ansari
13-Nov-23 23:31pm
View
Thank you for sharing the code snippet, I have posted a sample as solution-3.
M Imran Ansari
12-Nov-23 12:28pm
View
Share the four tables with attributes which you have tried? So that we can help out to establish the relationship.
M Imran Ansari
10-Nov-23 1:46am
View
What is the issue or question on this code snippet?
M Imran Ansari
2-Nov-23 17:26pm
View
You didn't mentioned the problem area. What issue you ae facing?
M Imran Ansari
2-Nov-23 17:24pm
View
which version you are using for itext7?
M Imran Ansari
1-Nov-23 16:58pm
View
Before executing the above query, make sure the column 'IsPush' was specified multiple times for 'cte'. remove the one entry of 'IsPush'
M Imran Ansari
1-Nov-23 7:00am
View
Thank you for your feedback. I want to clarify that I'm utilizing some search engines to find out the best possible answer if I have some misperception to generate comprehensive responses. To ensure transparency, I will include a reference note in my future messages. Your input is valuable, and I appreciate your understanding.
M Imran Ansari
1-Nov-23 2:39am
View
You're welcome. Happy Coding!
M Imran Ansari
28-Oct-23 18:24pm
View
You're welcome! I'm glad to hear that the solution worked for you.
Happy Coding!
M Imran Ansari
27-Oct-23 13:02pm
View
usually occurs when the connection string provided to establish a connection to the database is not in the correct format. To resolve this issue, make sure the connection string is correctly formatted with the appropriate key-value pairs
M Imran Ansari
22-Oct-23 13:01pm
View
DECLARE @Values NVARCHAR(MAX) = ''; -- Pass your values here
-- Checking if values are provided
IF @Values <> ''
BEGIN
DECLARE @Query NVARCHAR(MAX) = 'SELECT * FROM Student WHERE IsActive = 1 AND stu_Id IN (' + @Values + ')';
EXEC sp_executesql @Query;
END
ELSE
BEGIN
SELECT * FROM Student WHERE IsActive = 1;
END
M Imran Ansari
22-Oct-23 12:52pm
View
If that is the case you can achieve through a dynamic query that handles the IN clause when values are provided and ignores it when no values are provided, you can use a combination of conditional logic and dynamic SQL.
M Imran Ansari
22-Oct-23 2:40am
View
Ok. got it.
M Imran Ansari
21-Oct-23 16:47pm
View
Wonderful, glad to hear that.
M Imran Ansari
19-Oct-23 16:47pm
View
Can you share your scenario through jsFiddle?
M Imran Ansari
19-Oct-23 16:40pm
View
I think this is a duplicate question of the below one:
https://www.codeproject.com/Questions/5370350/How-to-disable-double-click-using-jquery
If yes, kindly remove this or groom the problem statement.
M Imran Ansari
8-Oct-23 13:56pm
View
Kindly share the complete code with context so that we can help out.
M Imran Ansari
8-Apr-23 0:44am
View
placePairs() method that is being called in the main() method is missing in your above code. Without this method, the code will not compile, I hope that would be there.
M Imran Ansari
28-Jan-23 13:52pm
View
Happy to hear second solution works for you and that's the grade/star. Cheers :)
M Imran Ansari
13-Nov-22 16:15pm
View
Your code is looking good. What error you are getting?
M Imran Ansari
4-Apr-22 3:09am
View
You are storing into character and calculating arithmetic operation, which is calculating as per ASCII values. What is your expected output? You
M Imran Ansari
24-Mar-22 5:52am
View
My pleasure.
M Imran Ansari
17-Mar-22 13:17pm
View
I did and mentioned from for loop. I don't think it duplicate of yours. Anyways user found his solution.
M Imran Ansari
17-Mar-22 10:45am
View
Well... Check your with this part????
You have mentioned ("|" + DS.Tables[0].Rows[i][1]) and in this part you have again mentioned DS which is not correct. there should be 'ds' whereas using DS. isn't it? There are three occurrences where DS was used.
M Imran Ansari
16-Mar-22 22:17pm
View
Could you please explain?
M Imran Ansari
4-Mar-22 8:56am
View
much required in development :)
M Imran Ansari
24-Feb-22 16:16pm
View
OK. What is you final query? Can you post your sqlInsert value?
M Imran Ansari
24-Feb-22 15:49pm
View
I have updated my answer. There should also be a space before VALUES. Please check now
M Imran Ansari
21-Feb-22 4:56am
View
One extra character was creating an issue. Thanks for highlight.
M Imran Ansari
17-Feb-22 5:51am
View
You can implement just like a dual authentication mechanism. Check on direct access weather user is login through public login or not. If user is accessing direct link and publicAuth is fs false then you can redirect on Login Application page otherwise keep on that page.
You can achieve through URL pattern using IIS rules. Read for more information:
https://social.msdn.microsoft.com/Forums/en-US/eb38d418-a519-4e15-9626-72ed7557752c/prevent-direct-url-access-of-files?forum=iis7general
M Imran Ansari
16-Feb-22 13:02pm
View
Improved my answer with VB. Thanks for pointing out. :)
M Imran Ansari
15-Feb-22 22:43pm
View
Thank for highlighting, I had improved the answer.
M Imran Ansari
14-Feb-22 16:52pm
View
Yes. That is a format_mask applied on resulted value. There should be a single dot with value.
M Imran Ansari
13-Feb-22 13:14pm
View
Great. Happy Coding!!
M Imran Ansari
13-Feb-22 2:57am
View
Just to check the behaviour of code, could you please share the screenshot?
M Imran Ansari
12-Feb-22 23:54pm
View
Which class object you called in Main method?
M Imran Ansari
11-Feb-22 7:42am
View
Pleasure. Happy Coding!!
M Imran Ansari
8-Feb-22 7:06am
View
Pleasure. Happy Coding!!
M Imran Ansari
7-Feb-22 9:12am
View
Yes, Can hold 22 digits means including both sides. Where 19 digits are before
the decimal point and 3 digits are after the decimal.
M Imran Ansari
6-Feb-22 3:11am
View
Kindly improve your question on clicking green button 'Improve question' and give what you have in 'preds' collection and also mentioned the others parameters value.
M Imran Ansari
5-Feb-22 14:58pm
View
Pleasure. HaPpy Coding!!
M Imran Ansari
4-Feb-22 15:52pm
View
No one can solve your task, just try yourself and share the code where you are stuck.
M Imran Ansari
4-Feb-22 14:07pm
View
Pleasure. Happy Coding!!
M Imran Ansari
4-Feb-22 10:11am
View
Cheers.
M Imran Ansari
3-Feb-22 2:42am
View
Your question is not cleared. please share the code snippet where you are facing an issue. The best solution is debug your application and find the exact location of exception and share that here. Click on Improve question button to add more detail.
M Imran Ansari
2-Feb-22 16:00pm
View
I have modified the code, please check now.
M Imran Ansari
2-Feb-22 8:46am
View
With hidden ID column also working as expected.
https://jsfiddle.net/ktbzmpwq/
M Imran Ansari
2-Feb-22 6:03am
View
Thanks for the explanation. I’ll check and review my solution.
M Imran Ansari
2-Feb-22 5:35am
View
Agreed. But when we worked with big files sometimes we get into memory issues like OutOfMemory exception while processing file due to low resource (I have also experienced such issue and achieved through PS scripts) and then we will achieve though an alternative approach.
Thanks for detail clarification on second point.
M Imran Ansari
2-Feb-22 5:18am
View
According to problem statement working in C#. Secondly, Why we get old questions in Active pane?
M Imran Ansari
2-Feb-22 4:31am
View
Add a hidden field, store the msg1 value into hidden field on post you page and then get the value from your hidden field.
input type="hidden" id="message1"
document.getElementById("message1").value = msg1;
echo $_POST['message1'];
M Imran Ansari
1-Feb-22 13:48pm
View
I have created a fiddle to demonstrate how to get table ID data. Check the link:
https://jsfiddle.net/fqu059aL/
M Imran Ansari
1-Feb-22 5:41am
View
What you have tried is also giving the same/expected result which you show in your question.
M Imran Ansari
31-Jan-22 23:02pm
View
client_id and client_secret are your credential to get authentication oauth2/token.
M Imran Ansari
31-Jan-22 10:53am
View
Great. Good Luck.
M Imran Ansari
31-Jan-22 9:53am
View
Great. Happy Coding!!
M Imran Ansari
31-Jan-22 8:07am
View
Great. Happy Coding!!
M Imran Ansari
31-Jan-22 7:14am
View
You question is not cleared. Clink on Improve question and update what actually you are looking for.
M Imran Ansari
30-Jan-22 1:00am
View
Great. Happy Coding!!
M Imran Ansari
29-Jan-22 14:58pm
View
share complete code is not a good idea. review the code and share the problematic area.
M Imran Ansari
29-Jan-22 14:54pm
View
In error list select the Build+Intellisence to show all errors.
M Imran Ansari
27-Jan-22 23:53pm
View
Try to write program in language which you have skills and then share the problem which you will face. Definitely, we are here to help you and resolved your problems.
M Imran Ansari
27-Jan-22 17:03pm
View
Your question is not cleared. Click on Improve Question button and add more detail.
M Imran Ansari
27-Jan-22 3:57am
View
It should work. I have tested on Windows and don't have Linux environment to test this. You can check the following links:
https://github.com/dotnet/runtime/issues/48111
https://doc.qt.io/qt-5/appicon.html#setting-the-application-icon-on-common-linux-desktops
M Imran Ansari
26-Jan-22 4:28am
View
It was showing under Active pain and I have replied to add some more links.
M Imran Ansari
25-Jan-22 13:32pm
View
As per your sample code write as:
string yourText = "";
if (Directory.Exists(@"D:\TASK"))
{
yourText = "FOUND A DB ON D: DRIVE";
}
if (Directory.Exists(@"D:\TASK"))
{
yourText += "FOUND A DB ON D: DRIVE";
}
else
{
yourText += "DB NOT FOUND ON D: DRIVE";
}
textBox1.Text = yourText;
M Imran Ansari
25-Jan-22 13:07pm
View
My pleasure. HaPpy Coding.
M Imran Ansari
25-Jan-22 12:49pm
View
If you want to run your code if directory Exists then use the following condition in if block:
if (Directory.Exists(@"D:\TASK"))
{
// Write code If directory exists
}
else
{
// Write code If directory not exists
}
M Imran Ansari
25-Jan-22 9:36am
View
Did you check the shared GitHub code link?
M Imran Ansari
25-Jan-22 8:52am
View
You can get the uploaded file as per above code.
Correct. Pass your search text through includes method.
M Imran Ansari
24-Jan-22 0:05am
View
Improve your question, your requirement is not cleared.
M Imran Ansari
23-Jan-22 15:20pm
View
Try the following line
Dim cmdI As New RelayCommand(AddressOf OpenUserInput)
M Imran Ansari
21-Jan-22 9:53am
View
Please elaborate you problem well and give more detail. How you will declare as Invalid or special number?
M Imran Ansari
21-Jan-22 7:39am
View
Have your issue resolved? If you are facing any issue let me know.
M Imran Ansari
20-Jan-22 23:43pm
View
Check the following link for libraries:
https://cloud.google.com/text-to-speech/docs/libraries
Try also Using_the_Web_Speech_API:
https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API
M Imran Ansari
20-Jan-22 15:11pm
View
I would recommend download on your local storage and play though Windows Media Player and after that delete from your local if not required further. If you required in future then save like as cache. In subsequent request first check cache if found play from there otherwise download and then play.
M Imran Ansari
20-Jan-22 14:42pm
View
If you want to download, please follow the link:
https://stackoverflow.com/questions/7757881/c-sharp-download-text-to-speech-from-google-translate-comes-with-problems
M Imran Ansari
20-Jan-22 14:40pm
View
You want to download?
M Imran Ansari
18-Jan-22 8:29am
View
After this query Day_date should be like '2022-01-18' and see your attend table (as per attached image) date is saving like '2022-01/17'. Why so?
M Imran Ansari
18-Jan-22 8:10am
View
In your attached image date format of Day_date = '2022-01/17' but when we call CURDATE() it returns '2022-01-17'. Please check the format of inserted data.
M Imran Ansari
18-Jan-22 6:55am
View
Have you checked the date format of inserted records of attend table?
M Imran Ansari
18-Jan-22 5:59am
View
What is value of curdate()? and check the format of date which already exists inthe attend table.
M Imran Ansari
17-Jan-22 16:29pm
View
Yes. As per problem statement "insert the rest of the student that didn’t sign in into attend table"
M Imran Ansari
17-Jan-22 14:08pm
View
Great Answer.
M Imran Ansari
17-Jan-22 13:44pm
View
It Seems to be your assignment and better you solved by yourself and share the code where you face any issue.
M Imran Ansari
17-Jan-22 7:25am
View
Yes. myObj is just a reference (hashCode is a randomly generated number and has nothing to do with the address) of memory location not the actual/physical address (physical address is not accessible)
M Imran Ansari
17-Jan-22 5:56am
View
Thanks for the highlighted. Might be some network glitch. I have deleted 2 from the list.
M Imran Ansari
16-Jan-22 15:11pm
View
Use the following link:
https://www.tutorialspoint.com/highcharts/highcharts_column_charts.htm
M Imran Ansari
16-Jan-22 14:32pm
View
More then welcome. I hope now you will love to learn Java. :)
M Imran Ansari
16-Jan-22 14:10pm
View
I had modified the answer. check now.
M Imran Ansari
16-Jan-22 13:20pm
View
What do you mean by automatically? and I refer the location where you can put your own logic to trace your specific word, on the basis you want to triggered.
M Imran Ansari
16-Jan-22 12:00pm
View
My pleasure.
M Imran Ansari
16-Jan-22 9:33am
View
My pleasure.
M Imran Ansari
16-Jan-22 9:00am
View
Pleasure! Yeah, you can also use scaler function which return the totals.
M Imran Ansari
16-Jan-22 8:23am
View
In this scenario, we are not storing dates into string, we are just parsing datetime into correct format while creating the query.
M Imran Ansari
13-Jan-22 17:02pm
View
All you need is to call its Save method to save the changes Have you tried the following command?
My.Settings.Reset()
My.Settings.Save()
M Imran Ansari
13-Jan-22 4:41am
View
String designation = "Sales";
int counter = 0, n;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
String[] result; // Declare the array
if (n > 0)
{
result = new String[n]; // Initialize here
....
..
}
else
{
System.out.println("INVALID INPUT");
}
M Imran Ansari
12-Jan-22 10:07am
View
Source array, where values exists ie, SalesManager, SalesExecutive etc.
M Imran Ansari
12-Jan-22 6:20am
View
You can convert you Python code into C# using the link below link.
https://pythoncsharp.com/
M Imran Ansari
12-Jan-22 4:14am
View
What error you are getting on this string?
M Imran Ansari
12-Jan-22 1:39am
View
Yes. If you are looking to add %% with datepicker1, here we go
"Select * From itemsreceived " +
"WHERE date_format(DateCreated, '%Y-%m-%d') " +
"LIKE date_format('%" + datepicker1.ToString("yyyy-MM-dd") + "%', '%Y-%m-%d')" + ";";
M Imran Ansari
11-Jan-22 15:11pm
View
As per sample data price is integer and "double discount(int price, int d)" will work but if value in price will be decimal then yes should go with "double discount(double price, int d)".
Show More