Click here to Skip to main content
15,169,285 members

Comments by Ramesh Kumar Barik (Top 37 by date)

Ramesh Kumar Barik 8-Jul-17 9:27am View
   
Yes, It because of the query you have written in sql to retrieve the list.
If you want the result should come on the first letter then use % after the input parameter in like operator.

Ex: select * from dbo.TableName where ColumnName like 'a%'.
Ramesh Kumar Barik 7-Jul-17 2:03am View
   
If your UniqueId is a string you can not convert it to Bigint.
But if its datatype is string but the value is Bigint type then conversion can possible and will not throw any error.

Bigint same as Int64
Ramesh Kumar Barik 6-Jul-17 13:04pm View
   
Yes, ViewModel is the best approach.
Ramesh Kumar Barik 6-Jul-17 1:07am View
   
A ticket can be assigned to one user and when you retrieve the ticket info then you can know to whom this ticket assigned.
Ramesh Kumar Barik 1-Jun-17 5:22am View
   
If you create a separate function then no need to put in side Ready function. But if we create events(Click/Change events etc) then it needs to put those events in Ready function.
Ramesh Kumar Barik 10-May-17 6:12am View
   
You most welcome :)
Happy coding :)
Ramesh Kumar Barik 7-May-17 0:11am View
   
In which line it throws error?

Check you action method.
var user = db.Customers.Single(u => u.CST_Username == id);
As you are comparing the id with your name properties which may returns null.
Is is correct?

Ramesh Kumar Barik 5-May-17 8:47am View
   
Yes..
Ramesh Kumar Barik 5-May-17 6:07am View
   
Refer this link u can get better idea.
http://www.c-sharpcorner.com/UploadFile/653eb2/consuming-web-services-in-Asp-Net-mvc-5-application/
Ramesh Kumar Barik 3-May-17 1:58am View
   
Dear Sandeep,

You can refer this link.

https://forums.asp.net/t/2024764.aspx?Passing+form+data+to+a+controller+method+using+Ajax
Ramesh Kumar Barik 3-May-17 1:51am View
   
Dear Sandeep,
The same code I have written in my application it working fine for me.
Please check in debug mode what is the issue.

Thanks
Ramesh Kumar Barik 3-May-17 0:37am View
   
Dear Sandeep,
I have updated my answer please check and let me know whether it work.
Only add [WebMethod(EnableSession = true)]

Thanks.
Ramesh Kumar Barik 1-May-17 5:18am View
   
You have to implement authentication in API.
Refer this it may help you.
https://www.codeproject.com/Articles/1005485/RESTful-Day-sharp-Security-in-Web-APIs-Basic
Ramesh Kumar Barik 22-Apr-17 2:22am View
   
Convert the datatable to an entity(YourClass object) list and expose that list to your angular js.
Ramesh Kumar Barik 10-Apr-17 21:51pm View
   
Dear Chill60,

Its fine. I just forgot to use Union instead of Union ALl.

Thnx.
Ramesh Kumar Barik 10-Apr-17 11:57am View
   
It seems that in that, generated image is stored in the path.
Follow the steps that can help you.

Change the parameter datatype to Varchar(200);
Ex: @CustomerPhoto varchar(200)

from the application pass the generated file name to that parameter and it will store the newly generated file name in the DB.
When you retrieve the image from the DB then you can append the physical path with column value.
Ex:

Select 'http://store6.up-00.com/2017-04/'+ CustomerPhoto as CustomerPhoto from CustomersTbl where where CustomerID=@CustomerID.

Check this code it may help you :)
Ramesh Kumar Barik 10-Apr-17 11:40am View
   
It will work fine.
But you want to pass @CustomerPhoto value to the SP. So from the application side check whether the image file contains value or not.
Ramesh Kumar Barik 9-Apr-17 9:44am View
   
As per my suggestion save the file in another server and save the path in your database to know the file identity.
If you save the file content (binary) then your DB size my be heavy, if lots of file posted from the application. If you know your file is less then go for this option.
Thanks. :)
Ramesh Kumar Barik 9-Apr-17 9:00am View
   
Good to know problem solved.. :)
Ramesh Kumar Barik 9-Apr-17 8:58am View
   
Check on which line the issue occurred.
It seems that the value which you want to convert to integer, is not in integer format.
Ramesh Kumar Barik 9-Apr-17 7:35am View
   
Is one employee having multiple designation?
Can you pls share the some data of your tables in scree shot?
Ramesh Kumar Barik 7-Apr-17 7:15am View
   
1.Check you view,
@model YourClassName

2.Check you action method
The model(YouClassName object) which you return from action method to view is same or different and check the return model has data or not.
Ramesh Kumar Barik 7-Apr-17 2:36am View
   
Yes you can.
If you know the webservice (Hosted) URL then you can set this URL link in you web config file and in application you can use this.
Ramesh Kumar Barik 6-Apr-17 6:10am View
   
Deleted
http://www.diogonunes.com/blog/calling-webservice-without-wsdl-or-web-reference/
http://stackoverflow.com/questions/26603053/how-can-i-call-a-soap-web-service-without-adding-web-reference
Ramesh Kumar Barik 6-Apr-17 6:09am View
   
Deleted
http://www.diogonunes.com/blog/calling-webservice-without-wsdl-or-web-reference/
http://stackoverflow.com/questions/26603053/how-can-i-call-a-soap-web-service-without-adding-web-reference
Ramesh Kumar Barik 24-Mar-17 11:04am View
   
Yes you can redirect to other external sites like mentioned site.
Same syntax you can use to redirect from you application.

Ex:
Response.Redirect("http://www.southdelhiadvocate.com/Default.aspx")
Add http:// before your link.
Ramesh Kumar Barik 23-Mar-17 13:52pm View
   
If you want to redirect to another page on button click then u need to write the this Response.Redirect("YourPage.aspx") / Response.Redirect("www.codeproject.com") method in button click event.
Ramesh Kumar Barik 21-Mar-17 13:18pm View
   
Refer this link it may help you

http://www.c-sharpcorner.com/UploadFile/225740/introduction-of-session-in-Asp-Net/
Ramesh Kumar Barik 18-Mar-17 14:16pm View
   
Welcome Dude. :) Keep coding..
Ramesh Kumar Barik 25-Jan-17 6:48am View
   
Yes, Model is only the data communicate between view (html pages etc) and Controller.
Ramesh Kumar Barik 25-Jan-17 5:51am View
   
The model of that view can not directly pass to the jquery function.
As you only want to pass the model single object data with the list of data to the action method. As you have created the class object for your action method. create same structure in Jquery and post same through ajax method.
Ramesh Kumar Barik 25-Jan-17 5:32am View
   
function saveData(varhallId) {
var hall_Place_link = new Array();
$("#tblPlaceList").find("tbody").find("tr").each(function () {
hall_Place_link.push({
hallPlaceId: $(this).find("td:eq(0)").html(),
placeName: $(this).find("td:eq(1)").html(),
placeDescription: $(this).find("td:eq(2)").html(),
avDrawing: "",
hallId: varhallId
});
});

$.ajax
({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/Hall/Insert",
data: JSON.stringify({ obj: hall_Place_link }),
dataType: "json",
success: function (data) {
alert('Success')
},
error: function (x, e) {
alert('Failed')
}
});
}
Ramesh Kumar Barik 25-Jan-17 5:09am View
   
What is the issue?

1. Controller method is not called?
2. Or any issue in ajax call.
Ramesh Kumar Barik 9-Jan-17 23:54pm View
   
Then How you fetch the data from State table for a specific country.

As per the query "SqlCommand cmd = new SqlCommand("select StateName,CounID from State_details where CounID='" + DDlCountry.SelectedValue + "'", cn);" it always select same country as you are passing same column name in condition as well as in select statement.

Put this query in sql query window.
1. select CountryName,CounID from Country_details.
2. select StateName,CounID from State_details where CounID = 1 // Let set 1 for example.

Ramesh Kumar Barik 9-Jan-17 9:52am View
   
Thanks.
One Question.
How you relate your parent table (Country_details) and child table (State_details).

Is there any OwnID for State_details?
If yes, then select that ID and bind the same for StateDropDownlist.
Ramesh Kumar Barik 9-Jan-17 7:38am View
   
Issue : SqlCommand cmd = new SqlCommand("select StateName,CounID from State_details where CounID='" + DDlCountry.SelectedValue + "'", cn);

The query which u have mentioned it selects the StateName with COuntryID from state_Details table. But you should select StateName with StateID for StateDropdownlist for which the stateID will selected for StateDropdownlist.

Here the CounID is always same with parameter which you use in where condition.

1. So please change the query Statename with StateID for Statedropdownlist.

Ex: SqlCommand cmd = new SqlCommand("select StateName,StateID from State_details where CounID='" + DDlCountry.SelectedValue + "'", cn);

2. Ddlstate.DataValueField = "StateID";
Ramesh Kumar Barik 3-May-13 8:49am View
   
Thanx