15,915,172 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 Python 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 Kumarbs (Top 110 by date)
Kumarbs
30-May-16 5:33am
View
Yes, it is as datetime. But in conversion it is not able to convert as BsonValue
Kumarbs
30-May-16 4:53am
View
Tried that date type also. But got the same serialization exception.
str1.Append("{" + prop.Name + ":{$gt : " + Convert.ToDateTime(prop.GetValue(Model)) + " }}");
Kumarbs
23-Feb-16 3:56am
View
Thank you very much for your inputs.
Again, In what scenario ForbiddenHandlers will be helpful.
Kumarbs
23-Feb-16 0:03am
View
Thank you for your solution. The following code fixed my problem.
<system.webserver>
<modules>
<remove name="UrlAuthorization">
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule">
</add></remove></modules>
</system.webserver>
I have gone through Microsoft support site "https://support.microsoft.com/en-us/kb/815152" provided the solution like below
<system.web>
<httphandlers>
<add verb="*" path="*.doc" type="System.Web.HttpForbiddenHandler">
</add></httphandlers>
</system.web>
But this doesn't solve my problem. Could you have your thoughts on this?
Kumarbs
2-Dec-15 3:46am
View
No Use
Kumarbs
2-Dec-15 2:36am
View
Deleted
I decorated the web method with [ScriptMethod(UseHttpGet=true)] too.
Kumarbs
2-Dec-15 2:34am
View
public class cnt
{
public string cntName;
public string cntEmail;
public string cntMsg;
}
Kumarbs
2-Dec-15 2:33am
View
Thank you for your solution. But, unfortunately it is not working. Getting the exception "{"Message":"An attempt was made to call the method \u0027SaveSearch\u0027 using a GET request, which
is not allowed.","StackTrace":" at System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData
methodData, HttpContext context)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall
(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"
}"
I decorated the web method with [ScriptMethod(UseHttpGet=true)] too after getting the above exception. But still not working.
Kumarbs
2-Dec-15 2:21am
View
Following is the json data:
"{"cntName":"1","cntEmail":"2","cntMsg":"3"}"
Kumarbs
2-Dec-15 2:19am
View
ResponseFormat is not required in this. That doesn't make any sense in this as i am not returning back anything.
Kumarbs
3-Nov-15 2:26am
View
The MIME type for JavaScript is application/javascript (or the legacy text/javascript). Browsers do not recognise the non-standard javascript MIME type so will ignore the script.
Kumarbs
23-Sep-15 4:48am
View
Did you try by removing the ngRoute reference from creating the module.
like
var app = angular.module('routingDemo',[]);
Because ngRoute is built in in the latest version.
Using ngRoute
In AngularJS 1.2.0 and later, ngRoute has been moved to its own module. If you are getting this error after upgrading to 1.2.x or later, be sure that you've installed ngRoute.
Kumarbs
6-May-15 1:07am
View
Make sure the returning data from the service is in JSON format. Currently it is not in a JSON manner.
Kumarbs
6-May-15 0:54am
View
Could you provide some detailed code, where you are getting the issue? If possible provide the detailed issue.
Kumarbs
17-Nov-14 1:27am
View
( $scope.myFunc || $scope.$parent.myFunc ) ( );
Will execute the parent controller function? If so that will be fine.
But in this case, i think all the functions in the parent controller should be called in the directive. But in my case i would have 100's of functions in the parent controllers because i call the directive in many pages. I can't call these functions in the directive, they should be automatically fired.
Kumarbs
17-Oct-14 11:46am
View
Thank you for the feedback. But in the directive i have already created a controller to perform certain operations. Where as in your case you mentioned a controller outside of the directive and mapped it to the directive. But in my case the directive controller and the outside controller should work on top of the directive.
Thank you for your time spending on this.
Kumarbs
15-Oct-14 23:57pm
View
Thank you for the info. But i have tried this too but no doors are open. I will give some code snippet so that you may have a chance of giving more ideas.
<div ng-controller="controllername">
<my-directive>
In the controller i have a couple of functions like
app.controller("controllername",['$scope','function($scope))
{
$scope.functionName = function()
{
alert(1);
}]
}
I need to call this function in the directive controller.
Thank you for your time being spent on this.
Kumarbs
15-Oct-14 11:09am
View
I am not meant of using factory. If i use factory i can handle the data in between those. My problem is i have a controller and have a couple of functions handling on it. By default a controller has been registered for a directive. Now i want to execute both the controllers.
Kumarbs
18-Sep-14 8:55am
View
You can refer
http://www.developerscode.com/2013/08/2-ways-to-bind-data-to-gridview-using.html
Kumarbs
18-Sep-14 2:51am
View
You can't bind data in the web method, as it don't know about asp.net controls. You need to get the data from service and bind it using script.
Kumarbs
18-Sep-14 1:48am
View
Can you place your design code? So that it can be easy to provide the solution
Kumarbs
28-Aug-14 7:56am
View
Are you giving the home work to the techies here?
Kumarbs
27-Aug-14 5:31am
View
How many cells are there?
Kumarbs
27-Aug-14 5:23am
View
Make sure the no of cells are 13 as you used Cells[12].
Kumarbs
27-Aug-14 5:20am
View
Didn't refer any jquery file? You should refer a jquery file in order to work for that.
You can refer this jquery.
http://code.jquery.com/jquery-1.11.0.js
Kumarbs
26-Aug-14 6:21am
View
Improve your question, it is not understanding to respond. And get clear your question.
Kumarbs
26-Aug-14 6:17am
View
No issue in your code. Please check once and provide the feedback. Make sure the showpf() method not in the document.ready() method (i don't think so it is). Check the console screen in the browser if you are getting any error.
Kumarbs
26-Aug-14 3:29am
View
In this case, the list properties are same names. Hence if you wrote a query the first property satisfies the condition then it comes in the result. So please try to change the property names.
Kumarbs
26-Aug-14 3:23am
View
Better option i can prefer is go for lazyload jquery plugin to load images.
Kumarbs
26-Aug-14 3:07am
View
Ofcourse you can get the output but it is not based on the datetime, it works on strings. May be the string values are correct ones which satisfies your conditions. Try to select those strings in select command and try comparison with out convert then you knows the difference.
Kumarbs
25-Aug-14 8:51am
View
Make sure the endpoint is available in the webAPI web.config file.
Kumarbs
25-Aug-14 8:38am
View
What is your query?
Kumarbs
25-Aug-14 8:38am
View
Deleted
What is your query?
Kumarbs
21-Aug-14 5:45am
View
In this query ISNULL is maintained for 0 for building number only. So this will get output correctly.
Kumarbs
21-Aug-14 0:29am
View
I think building number is numeric hence the issue. You can use this.
select (CAST(ISNULL(BuildingNumber,0) AS NVARCHAR(20)) +', '+ ISNULL(BuildingName,'') +', '+ ISNULL(Postcode,'')) as CompleteAddress from AddressRecord
where( CAST(ISNULL(BuildingNumber,0) AS NVARCHAR(20)) +' ,'+ ISNULL(BuildingName,'') +' ,'+ ISNULL(Postcode,'') )like '%PL1 1DQ%'
Kumarbs
20-Aug-14 8:09am
View
Use this.
select (CAST(ISNULL(BuildingNumber,'') AS NVARCHAR(20)) +', '+ ISNULL(BuildingName,'') +', '+ ISNULL(Postcode,'')) as CompleteAddress from AddressRecord
where( CAST(ISNULL(BuildingNumber,'') AS NVARCHAR(20)) +' ,'+ ISNULL(BuildingName,'') +' ,'+ ISNULL(Postcode,'') )like '%PL1 1DQ%'
Kumarbs
20-Aug-14 7:06am
View
If this solves your prob accept this as a solution.
Kumarbs
20-Aug-14 2:59am
View
In your code
Kumarbs
20-Aug-14 2:49am
View
It won't work buddy.
Kumarbs
20-Aug-14 2:40am
View
What do you want? Where is your question?
Kumarbs
18-Aug-14 8:49am
View
Do you have "ValidationGroup" property to clear button, if so remove it.
Kumarbs
18-Aug-14 6:21am
View
Your code is absolutely correct. I worked at my local. The way you are consuming is the only problem. Make sure you construct the "query" object properly and send back to server.
As i said prior
var Query = { name: "test",startDate:"",endDate:"" };
$.ajax({
url: '/api/subset',
data:Query,
type: 'POST',
success: function (data) {
}
});
Is worked for me.
Kumarbs
18-Aug-14 6:16am
View
In some place you are assigning values to style right?, if so make sure to construct like above.
Kumarbs
12-Aug-14 7:33am
View
Ex: string[] style = new string[] { "1", " ", "2" };In this array you have a blank value and this will be added to the parameters and finally string will be "1, ,2".
Kumarbs
12-Aug-14 6:15am
View
You are constructing the parameters values from the "style" array. Make sure you have a empty value in the array. Or else you comment the code
SET @InStr = REPLACE(@InStr + ',', ',,', ',')
in your function. I think it is skipping the empty values.
Kumarbs
12-Aug-14 6:08am
View
Are you expecting null or empty in parameters in the below line
cmd.Parameters.AddWithValue("@Liststyle", parameters);
Kumarbs
12-Aug-14 5:57am
View
Do you mean you are getting values even if you pass the null or empty values?
Kumarbs
12-Aug-14 5:46am
View
Can i expect your input and output, so that i will give solution
Kumarbs
12-Aug-14 5:39am
View
Are you not able to pass the empty parameters or if you pass empty the expected result is not coming?
Kumarbs
12-Aug-14 5:35am
View
Never go for the dynamic queries, unless until it is required. for this small query no need of that.
Kumarbs
12-Aug-14 5:32am
View
Can you improve your question? It is not clear to understand.
Kumarbs
12-Aug-14 4:58am
View
Well, if the string is constructed at db level, it works perfectly.
Kumarbs
12-Aug-14 3:27am
View
Even if you use the IN operator in where clause you will get the output. Is there any specific reason to convert to int?
Kumarbs
12-Aug-14 3:24am
View
Can you make sure you are getting single value in @group.First() and item. I know group.first() gets only one value. But would like to cross check it.
Kumarbs
12-Aug-14 3:12am
View
What would you like to convert cid in select statement or something else?
Kumarbs
11-Aug-14 3:18am
View
I thought you got the solution. But so sad.. Where you are consuming the web api? Apart from fiddler do you use any scripting to call the web api?
Kumarbs
11-Aug-14 2:29am
View
ModelState getting invalid means the datetime format is mismatching the required format. Ensure you are passing correct format.
Kumarbs
11-Aug-14 0:09am
View
Make sure the content type is "application/vnd.ms-excel". You Can refer
http://www.c-sharpcorner.com/uploadfile/0c1bb2/uploading-and-downloading-excel-files-from-database-using-as/
Kumarbs
11-Aug-14 0:00am
View
Deleted
Whatever the methodology you are going to adopt, you need to construct Query Class and send back to controller. It is expecting that when you made a call to that.
Kumarbs
8-Aug-14 8:11am
View
Where did you write the data to the excel file?
Kumarbs
8-Aug-14 8:02am
View
Can you clear your question?
Kumarbs
8-Aug-14 0:23am
View
Just check with this article
http://www.codeproject.com/Articles/800608/Creating-and-Consuming-Web-API-hosted-on-Azure-Emu
To enable cors properly. As you made enable cors, you don't require to put crossdomain=true.
Kumarbs
6-Aug-14 1:07am
View
Thank you for your inputs.
Kumarbs
5-Aug-14 5:26am
View
What is the error you got?
Kumarbs
1-Aug-14 8:40am
View
You can maintain null value for 1&0 condition.
Kumarbs
1-Aug-14 4:49am
View
You used private setter, i think that is the problem. Ensure that.
Kumarbs
1-Aug-14 3:10am
View
No matter which method you called, you won't get the controls in the web methods. They are pure c# methods, you won't identify any asp.net control.
Kumarbs
1-Aug-14 2:59am
View
In service method, no controls will be identified.
Kumarbs
1-Aug-14 2:15am
View
Which db you are using? And you are asking 100 records, meant based on some condition or top 100?
Improve your question.
Kumarbs
1-Aug-14 1:44am
View
Is duplicate data available in table too? or only in grid?.
Kumarbs
1-Aug-14 1:40am
View
Please rate this solution if it provided the proper solution.
Kumarbs
1-Aug-14 0:55am
View
You can write a linq query to get this.
Kumarbs
1-Aug-14 0:46am
View
Every one has a different approach, instead of db looping statements, we can pass concatenated string. Here test1,test2 are controls values. In your code "combo_box_1()" returns 20 values so all these values are comma separated as i mentioned above. So you need to pass 8 parameters and each parameter is a concatenated string.
You can just query it in the sp as above, not a pblm it executes.
Kumarbs
1-Aug-14 0:14am
View
I provide the query in the solution.
Kumarbs
1-Aug-14 0:04am
View
You got 404 error means, the file you are looking is not found. As in your code the last statement you derived is for "Access Denied". May be you are not an admin while you testing. Hence the error. Plz make sure you are testing with Admin.
I have tested your code by creating my end. I am perfectly going into the post method and displaying some messages in my console.
I used the jquery call by constructing the jquery object and called the method like follwoing.
var Query = { name: "test",startDate:"",endDate:"" };
$.ajax({
url: '/api/subset',
data:Query,
type: 'POST',
success: function (data) {
}
});
If it works in fiddler you will be fine. Let me know if it works for you.
Kumarbs
31-Jul-14 23:38pm
View
Creating script level means, you need to construct an Jquery or Javascript object and pass it to the api.
Kumarbs
31-Jul-14 8:47am
View
public string combo_box_1()
{
foreach (Control ctrl in this.Controls)
{
if (ctrl is ComboBox)
{
if (ctrl.Name.Equals("combo_box_1"))
{
string main_category = ctrl.Text;
string[] arr1 = { main_category };
foreach (string alph in arr1)
{
MessageBox.Show(alph);
return alph;
}
return main_category;
}
}
}
return null
In this code you just concatenate all the values in the arr1 so that you will get only one string with all the values separated with "," (As per our discussion 20 values with comma separated).
You pass this string to the db and there you can split it and perform insert.
Kumarbs
31-Jul-14 8:43am
View
Well, we can do it but the expected result you won't get. And you mentioned
"Query query" in this is "Query" is your model class? If so you need to construct at script level and pass that to the api.
Kumarbs
31-Jul-14 8:12am
View
Most Welcome.
Kumarbs
31-Jul-14 7:44am
View
Last question don't mind :). In your first code block you written "combo_box_1". And you are assigning this control value to an string array. Is this value a single string or array of strings?
Kumarbs
31-Jul-14 7:30am
View
Just check that value.indexOf(98) = 0 then show otherwise skip it.
Kumarbs
31-Jul-14 7:22am
View
No need of apologies. We skip sometimes, nopblm.
The error got here
if (!string.IsNullOrEmpty(query.name))
You are trying to get the name from the query but you are not verifying that the query is null or not, hence it throws the exception.
How you are calling the post method in views or fiddler?
If you are calling in the views, make sure you send the data to the post method.
For fiddler like http://localhost:45361/api/subset?query="your query value".
(I am not sure it works or not bcoz i didn't use fiddler prior :( )
Kumarbs
31-Jul-14 7:14am
View
You have written 8 methods and each returning one value. So for each control you are getting one value. As per your above comment this is fine. Then what is your problem?
Kumarbs
31-Jul-14 7:09am
View
I am not understanding the question, can you improve it?
Kumarbs
31-Jul-14 7:05am
View
Can you check the "query" value you are getting in the post method by debugging it?
Kumarbs
31-Jul-14 5:59am
View
well, in the question, as mentioned that you have many values for a single control and you want to save those values. Isn't it? If so how you can save it? all the values of a control in one column?
Kumarbs
31-Jul-14 5:56am
View
Can you check the "query" value you are getting in the post method? Also may i know how did you call this method(paste the code).
Kumarbs
31-Jul-14 5:48am
View
Question to you, how you are saving in the database? Each value in one column or all values related to one control in one column with comma separated?
Kumarbs
31-Jul-14 5:33am
View
Deleted
You used the code "dataGridView2.Rows.RemoveAt(0);", it only deletes the first record. Try to remove by looping the records.
Kumarbs
31-Jul-14 5:33am
View
You used the code "dataGridView2.Rows.RemoveAt(0);", it only deletes the first record. Try to remove by looping the records.
Kumarbs
31-Jul-14 5:06am
View
Is target control id (btnShowPopup) is defined in your code?
Kumarbs
31-Jul-14 4:59am
View
What you are expecting, creating a guid value or solution to your question. If it is regarding guid, You can create it like following.
string s = Guid.NewGuid().ToString();
You can store the value either in session or cookie and continue with your logic.
Kumarbs
31-Jul-14 4:49am
View
Did you find any exception in the browser console screen?
Kumarbs
31-Jul-14 3:11am
View
Please provide what is your expectation and what it returns. Elaborate the issue, so that it is easy to provide the solution
Kumarbs
31-Jul-14 2:11am
View
Can you share the aspx code?
Kumarbs
31-Jul-14 0:49am
View
Most Welcome.
Kumarbs
31-Jul-14 0:49am
View
Well, Async calls introduced in MVC4 itself, if you are not finding means, you are using prior versions. Alternatively you can use ajax calls in jquery.
Kumarbs
30-Jul-14 8:56am
View
I just gone through your code and find that you missed the opening quotes for Target=Test.
In order to identify the problems, you can create an xml file and open it in browser. If any exceptions available in the code, you won't able to execute the file. The errors reflects in the browser itself.
Kumarbs
25-Jul-14 6:16am
View
Then try to make a single statement by merging insert and select statements. Because you are looping many times. Or the best way is create a stored procedure.
Kumarbs
25-Jul-14 5:54am
View
Try it by adding cmd.commandtimeout =0. And i afraid to say working with the raw sql statements within the loops is a bad practise, instead you can go with StoredProcedure.
Kumarbs
24-Jul-14 2:30am
View
I understand that you are using DbCommand class to establish the connections and execute the commands, if so, for that also you can make the DbCommand.CommandTimeOut = 0 so that the process will wait until you get the records. If you are using "Using" class for execution of procudre or query, try to remove that as it has some problems in closing the connections as per my understanding. Let me know if it solves your pblm.
Kumarbs
24-Jul-14 1:43am
View
Ok. You can put that record in the transaction, until unless you commit/rollback that record no one is available to access that record.
Kumarbs
23-Jul-14 2:50am
View
Thank you Richard
Kumarbs
23-Jul-14 0:33am
View
Thank you for the feedback. Am asking the same, if i put the domain name and place my app in their machine and ran, then eventually it works, isn't it?
Kumarbs
22-Jul-14 8:58am
View
Exactly, your WCF Service has stopped when you were debugging, hence the issue was. Try to reproduce this by stopping the Service.
Kumarbs
22-Jul-14 8:46am
View
You mean the application and the service is same?
Kumarbs
22-Jul-14 8:44am
View
Can you please check that res value you are sending to the service is available properly. In the service it is not able to find a file, hence it shows the error outofrange index in " postedContext.Request.Files[0];" line.
Kumarbs
22-Jul-14 7:54am
View
Are you asking about MySql or Sql Server?
Kumarbs
24-Jun-14 3:08am
View
Deleted
ppp
Kumarbs
20-Jun-14 0:15am
View
Thank you for the solution. I know that writing query is a bad practice, but i am working on migration project so it is the only way i found :(.
And am using WEB API.
Well, i don't want to create a class again for the query as i mentioned in the question, because i am going to work with plenty of queries so for each query if i create a class, it might become app size more and moreover i won't know what are the fields we are going to retrieve as every query is dynamically getting from different sources. Could you please provide another way to solve it?
Thanks in advance.
Show More