Click here to Skip to main content
15,076,130 members

Comments by Prateek Dalbehera (Top 70 by date)

Prateek Dalbehera 17-Mar-17 3:18am View
Please cross verify the path & back/forward slashes, still if you are not able to download then there may some issues with your browser. Some links below which may help
Prateek Dalbehera 17-Mar-17 3:06am View
Then there is problem with the path given. BTW which browser you are using, i tested in chrome. Also specify the error message
Prateek Dalbehera 17-Mar-17 1:58am View
You can make any of the column value as link, so when user hovers over any row of that particular column, you can trigger the action.
Prateek Dalbehera 17-Mar-17 1:44am View
Can you please explain your query a bit clearly?
Prateek Dalbehera 17-Mar-17 1:34am View
Can you please ask in English?? It seems that there is some data type mismatch.
Prateek Dalbehera 16-Mar-17 2:50am View
Please specify the error with the details. Without proper error message, its impossible to find solution. Also, as you said if the problem is with 32bit/64bit then please try to install VS which is compatible wit your system.
Prateek Dalbehera 16-Mar-17 2:38am View
please let us know what error/exception you are getting while uploading. It will help to narrow down. Check if the same file is already existing in the given path.

This link "" may help.
Prateek Dalbehera 16-Mar-17 2:35am View
Ok, then please share the problem & solution as well so that it may help others. Thank you.
Prateek Dalbehera 16-Mar-17 2:20am View
Please cross verify the Cat_ID value in debug mode. It seems that from application the value which you are trying to insert is violating the foreign key constraint. Also, while inserting to db directly , have you used '0' as CAt_ID??
Prateek Dalbehera 15-Mar-17 8:47am View
You can convert the date in string format coming from datagrid, then do timespan or solution provided below to calculate. Not a big deal i guess. For complete solution, please share some of your code snippets
Prateek Dalbehera 15-Mar-17 8:40am View
Is the solution provided below not helping you?? It will return bool value according to date range. Or do you require something else?
Prateek Dalbehera 15-Mar-17 8:34am View
ok, how frequently is your application running? I mean to ask that how frequently the DateComparison method will be called?? Do you want something like if (Endday - Today <= 5) then show alert??
Prateek Dalbehera 15-Mar-17 8:26am View
Can you elaborate more what you want to achieve. BTW you can use TimeSpan for time calculation and write your logic in it.
Prateek Dalbehera 15-Mar-17 7:48am View
Have not think of such but a nice idea, like "execute" used in sql server for dynamic sql queries. As of now, its not supported. MS should start researching on it!!!!
Prateek Dalbehera 15-Mar-17 7:09am View
it seems that problem is with your db part not in code. Have you tried inserting the same value directly through ssms. Please try to insert in sql server and revert back.
Prateek Dalbehera 15-Mar-17 3:54am View
try to debug and verify what values are coming in the runtime, please check in your db code by inserting the same data , by directly running INsert statement in sql server. If its not inserting than there is problem with FK else check your C# code to verify what value its sending to database
Prateek Dalbehera 15-Mar-17 3:50am View
in config of server, have you used "*" or restricted to some specific domain?? also, check annotations in the method definition in server side code
Prateek Dalbehera 15-Mar-17 3:47am View
if its working while developer tools is enabled, plz check using fiddler, see if its making a request or not. To verify step by step, try using ajax beforeCall
Prateek Dalbehera 15-Mar-17 3:31am View
Please specify where you are facing problem, code seems ok. If you want to avoid the use of regular expression, please visit below link from w3schools.
Prateek Dalbehera 5-Aug-16 14:06pm View
Simple & straight forward solution...
Prateek Dalbehera 13-Jul-16 2:52am View
ya right, 1st check value in client side and then send to server side explicity with json type
Prateek Dalbehera 12-Jul-16 5:52am View
Please be specific ... where u want the change exactly... point out in ur code
Prateek Dalbehera 12-Jul-16 5:50am View
Guess, the data u r binding in client side through ajax/json is not populated in server side... 1st debug ur javascript code to whether data is coming properly to ajax method, if so then after check ur web method, debug & find out whether u r getting posted value in ur server side method or not... Please do the above and revert back...
Prateek Dalbehera 12-Jul-16 5:42am View
Prateek Dalbehera 12-Jul-16 5:40am View
Please debug & find out at which point it's throwing this exception. Probably you r trying use something which is not initialised... Please post more details about ur code for solution
Prateek Dalbehera 12-Jul-16 5:15am View
Hi , I am a c# developer & have never tried jsp... So no more idea abt that
Prateek Dalbehera 10-Jul-16 14:18pm View
can you use jquery ajax for post....
Prateek Dalbehera 5-Jul-16 6:26am View
Please ensure the external files(css,js...) you are referring are present in the given locations.
Also, you can do a F12 after loading the web page to get the real cause of exception.
Prateek Dalbehera 23-Jun-16 3:34am View
Straight & simple...
Prateek Dalbehera 23-Jun-16 3:30am View
to get the concept clearly, just merge solution1 & solution2 ... you will be clear with ur doubts.
Prateek Dalbehera 23-Jun-16 3:25am View
Basics of client server architecture needs to studied before starting coding directly.....
Prateek Dalbehera 19-Jun-16 10:26am View
Hi, plz put a debug point in ajax success and see the exception message, and post the same to get solution to your problem. "Not working" is not the way to post a query...
Prateek Dalbehera 9-Jun-16 5:47am View
Please provide details of how you getting data from database , you are using ajax call or you are calling web service directly???
Prateek Dalbehera 9-Jun-16 5:46am View
Hi, just confirm us that how you are binding data to the drop down list, while binding itself you can restrict unwanted data or in jquery also you can do the same. please let us know how you are binding data.
Prateek Dalbehera 9-Jun-16 5:38am View
hi, i think you want to show the submitted data in the partial view as soon as the form is submitted... If it is so, then reply to this so that i can post the solution..
Prateek Dalbehera 9-Jun-16 5:29am View
a typical jquery ajax call:
type: "POST",
url: "/Home/GetCities",
data: '{text:"' + request.term + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
error: function (response, status, error) {
alert('in error');
failure: function (response) {
alert('in failure')

so, I think you need to specify all properties but you missed contentType & dataType in your code...
Prateek Dalbehera 8-Jun-16 0:58am View
Most welcome...
Prateek Dalbehera 8-Jun-16 0:58am View
Great point Richard... Always encoding is preferred because sometimes special characters would create create issues while passing from browser to server...e.g. while passing backslash(/) may create issues..
Prateek Dalbehera 3-Jun-16 6:24am View
As told by Griff, please provide details to get any solution...
Prateek Dalbehera 2-Jun-16 8:07am View
May you dont have access to copy files.
In my config file, I access mapped drive by using the below path -
I take this value from config file & convert it to a string & use.
Prateek Dalbehera 2-Jun-16 8:00am View
In the url, after /products, you should use query string, so the correct format may be like /products?paramName=paramValue
Prateek Dalbehera 2-Jun-16 7:54am View
If not EF then you can use old stuffs to achieve the same. But, the solution depends on what exactly you need.
Prateek Dalbehera 2-Jun-16 1:17am View
Its clearly a network related issue if ur code is working in ur local machine... plz consult a senior developer regarding it.
Prateek Dalbehera 1-Jun-16 5:50am View
Please debug and mention exactly at which point you are getting null reference issue.
Prateek Dalbehera 31-May-16 5:12am View
Have u included the required namespaces for that???
Prateek Dalbehera 31-May-16 3:11am View
Please clear that its dataset or datatable, if its datatable then you iterate through it and append the values to stringbuilder and finally, textbox.text = stringbuilder.tostring(); also u need to use text area for this. but why do u want to do like as its seems ugly practice.
Prateek Dalbehera 31-May-16 2:58am View
If ur mail sending is failed due to any certificate issues, then it will fix that but as i said not advisable to use, have u tried the event what i mentioned above.
Prateek Dalbehera 31-May-16 2:47am View
you are doing password validation in client side or server side. please post the complte code how you are vaLIDATING... May be some encoding issues will be there.
Prateek Dalbehera 31-May-16 2:34am View
Also, try to write this just before smtp.send method, below is not the advised way but you try just for testing purpose.

ServicePointManager.ServerCertificateValidationCallback =
delegate(object s, X509Certificate certificate,
X509Chain chain, SslPolicyErrors sslPolicyErrors)
{ return true; };
Prateek Dalbehera 31-May-16 2:31am View
Its quite complicated then if there will be network issues then u ll not be able to send any mail. There is an event for mail sending completed in C#, try if this event is hit or not after sending mail.

// Summary:
// Raises the System.Net.Mail.SmtpClient.SendCompleted event.
// Parameters:
// e:
// An System.ComponentModel.AsyncCompletedEventArgs that contains event data.
protected void OnSendCompleted(AsyncCompletedEventArgs e);
Prateek Dalbehera 31-May-16 1:38am View
sorry,these are variables of my code, you can simply write, mail.To.Add() and mail.CC.Add(). Please post the error message what u are getting, then only somebody can identify what the actual issue is.
Prateek Dalbehera 30-May-16 7:25am View
Related to ExecuteNonquery(); , it will return the no of rows affected, so it will "1" if your query worked in database else "0" if query failed due to any reasons.

Here, you can cross check whether user.Id is initialised or not before coming to this block
Prateek Dalbehera 30-May-16 6:54am View
As told by Karthik & member__64 , you can first do an alert() to check whether data is coming properly or not and then you can pass the same data inside data:"{}"
as data:"{CompanyId: CompanyName}"....

ALSo, use POST instead of GET.

But, wait.. one thing I found was in your controller you are expecting INT but from js you are sending STRING?? You can explicitly convert that from string to INT if the string is in proper int format.

Also, you need to provide contentType parameter as well in the ajax call or else it will not work.
And, one more suggestion is first do understand complete concept & related theories then try to write the code.
Prateek Dalbehera 30-May-16 6:37am View
u r mst welcm...
Prateek Dalbehera 30-May-16 4:03am View
So, if its a comma separated string then its not binding Right??
Prateek Dalbehera 30-May-16 3:56am View
Hi vaibhav, initially ,your 2nd drop down will be empty or default value and onselectedindex changed event of 1st drop down , u can call ajax method and update the same.
Prateek Dalbehera 30-May-16 3:47am View
Agree with Peter, So Juli, you try the following code to avoid any issues,


While sending from controller to API, send like above, In your case, it will be like,

Prateek Dalbehera 30-May-16 3:39am View
My initial diagnosis shows that you used "GET" instead of "POST" in ajax call.
I think it wont hit the server at all as its GET.
Please change the following and try again,

type:"GET", should be type:"POST", as in controller its post.
Prateek Dalbehera 28-May-16 13:33pm View
Ya bro... it ll be useful in future 4 him...
Prateek Dalbehera 28-May-16 12:30pm View
Perfect and exact solution, right from beginning to end. Simply, first do a JSON.stringify() to convert a string to JSON string format and then parse using JSON.parse() to convert a json string to object.
Prateek Dalbehera 28-May-16 12:12pm View
If there are more no of parameters, then its elegant to use object format. Here, you can create a new class as User and all the textbox values as its properties. While sending from JS,send in object format sothat in server side web method you have give only one parameter as User u instead of all properties.
Prateek Dalbehera 23-May-16 13:59pm View
Just find a workaround, if it matches your requirement, you can try it:
Replace '-' in the string if any & then spilt wrt ','.

Now, in the array, there should be only integers... but you can also think of a REgex for the same.
Prateek Dalbehera 23-May-16 13:44pm View
What I guess is , when user will enter any color name/color code that color should appear in a label or any other stuff. So, you need to have control on what the user will enter, means you can restrict the user input to some values. in place of red , user shouldnt enter erd.
Prateek Dalbehera 23-May-16 3:14am View
Thanks for the catch, I have updated the code.
Prateek Dalbehera 21-May-16 13:48pm View
After going through your question, what I found was you need autocomplete for Subject & institute. So, I would strongly recommend to use two different autocomplte because you can call using one method but inside the call, method name & data would be different. But if you want to use only one method you can also make it dynamic as you have done for ids.
Prateek Dalbehera 21-May-16 13:37pm View
Use moment.js and set time values accordingly, it will reduce your code and also easier for you...
Prateek Dalbehera 21-May-16 13:34pm View
First thing is if its an ui related issue , you have to post with screenshots and secondly define Not Working properly because anyone seeing ur question does not know what is Not Working according to you...
Prateek Dalbehera 21-May-16 13:01pm View
Using any method to filter data more accurately sothat least data will appear in the autocomplete suggestions...
Prateek Dalbehera 21-May-16 12:58pm View
I haven't used datetimepicker but can suggest you to use Moment.js for time related stuffs, here, what you can do is store start time in a moment variable and when user selects endtime compare that value with prevoiusly stored variable to do the validations... Just my idea, you can try...
Prateek Dalbehera 18-May-16 7:51am View
Sorry bro, you cant assign value to a server side variable(here,Model(ListPostID)). Because, when you run the application, the server side code will not appear there.

You have send this data to server side through ajax or any other method and update the same.