15,892,298 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 El Dev (Top 127 by date)
El Dev
12-Apr-19 5:10am
View
Hello F-ES Sitecore,
I am not getting you well, in few words how should I access the value cause I can see the file uploaded but am not able to select that value that has a .pdf extension...
Please help me by showing a JQuery selector as I am selecting other element and showing values like this line of code:
var pdfname = $('#<%=AsyncFileUpload2.ClientID%>').val();
alert(pdfname);
El Dev
1-Jun-15 5:51am
View
Thanks it works.
El Dev
12-May-15 19:43pm
View
yeah I did! it seems like the internet have some issue, thats why I am deploying on local server.
El Dev
12-May-15 13:41pm
View
Yeah you right it is a desktop. So do you think it is not due to IIS or win server the way they are setting up?
And the application hosted in Local server are faster than online. So if I buy the hardware it might be easier because I can not rely on internet here.
So please give some nice advice.
El Dev
15-Apr-15 6:45am
View
Is there any thing I need to configure from IIS?
El Dev
15-Apr-15 6:34am
View
it is my local IP Address.
El Dev
15-Apr-15 6:21am
View
I did that. I have put in the IP Address field from the Site Biding with my IP Address. which is this one 192.168.40.26
El Dev
15-Mar-15 9:22am
View
Yeah there is a difference but it does not work too. I am getting the last record but many times.
El Dev
15-Mar-15 8:46am
View
See what I did but now its giving the last record only, the 2 different records are showing up.
public static List<roominfo> GetAvailRoom(string Checkin, string Checkout)
{
DateTime CheckinDate = DateTime.ParseExact(Checkin, "M/dd/yyyy", CultureInfo.InvariantCulture.DateTimeFormat);
DateTime CheckoutDate = DateTime.ParseExact(Checkout, "M/dd/yyyy", CultureInfo.InvariantCulture.DateTimeFormat);
List<roominfo> lstRooms = RoomInfo.GetRooms();
List<roomimage> lstRoomImages = new List<roomimage>();
List<roominfo> lstRoomsNew = new List<roominfo>();
RoomInfo _RoomInfo = new RoomInfo();
_RoomInfo.Checkin = CheckinDate;
_RoomInfo.Checkout = CheckoutDate;
var roomAvailable = _RoomInfo.GetAvailableRoomByDate();
lstRoomsNew.Add(_RoomInfo);
foreach (var items in roomAvailable)
{
_RoomInfo.RoomId = items.RoomId;
_RoomInfo.RoomTitle = items.RoomTitle;
_RoomInfo.RoomName = items.RoomName;
_RoomInfo.RoomPrice = items.RoomPrice;
_RoomInfo.RoomDescription = items.RoomDescription;
_RoomInfo.IsBookButton = items.IsBookButton;
if (_RoomInfo.RoomId > 0)
{
RoomImage _RoomImage = new RoomImage();
_RoomImage.RoomId = _RoomInfo.RoomId;
var LstOfImages = _RoomImage.GetRoomImagesByRoomId();
HttpContext.Current.Session["RoomId"] = _RoomInfo.RoomId;
foreach (var images in LstOfImages)
{
_RoomInfo.RoomImageId = images.RoomImageId;
_RoomInfo.RoomId = images.RoomId;
_RoomInfo.LSTImages = LstOfImages;
}
}
else
{
string lblMsgError = string.Empty;
lblMsgError += string.Format("<div id=\"ShowError\" class=\"NotificationError\">{0}</div>", _RoomInfo.RoomNotAvailable);
}
}
return lstRoomsNew;
}
El Dev
15-Mar-15 8:30am
View
No I am not using it anywhere.
El Dev
15-Mar-15 7:51am
View
Hi OriginalGriff,
Still same problem is coming.
I just move the instance inside the loop and then add the items to the list but it is still giving the result of last records 2 times...
El Dev
7-Mar-15 5:15am
View
This is my webmethod code from c#:
public static string GetReservationById(int Id)
{
ReservationInfo _ReservationInfo = new ReservationInfo();
_ReservationInfo.ReservationId = Id;
var result = new
{
reservationInfo = _ReservationInfo.GetReservationById(),
};
var serializer = new JavaScriptSerializer();
return serializer.Serialize(result);
}
#endregion
and this the code inside the GetReservationById() method:
public IEnumerable<reservationinfo> GetReservationById()
{
using (SqlDataReader reader = SqlHelper.ExecuteReader(SqlHelper.GetConnection(), "[GetReservationById]", ReservationId))
{
if (reader.HasRows)
{
while (reader.Read())
{
yield return new ReservationInfo
{
Checkin = Convert.ToDateTime(reader["Checkin"]),
Checkout = Convert.ToDateTime(reader["Checkout"]),
};
}
}
}
}
and this my sp:
ALTER proc [dbo].[GetReservationById]
@ReservationId int
as
begin
select RS.ReservationId,convert(nvarchar(50),RS.Checkin, 101) as Checkin, convert(nvarchar(50),RS.Checkout, 101) Checkout,RS.IsReservedOn, RS.IsModifiedOn,
C.CustomerFirstName, C.CustomerSecondName, C.CustomerEmail, C.CustomerTelephone,
C.CustomerAddressLine1, C.CustomerPOB, C.City, C.Country, R.RoomName,
R.RoomPrice, R.RoomDescription, R.RoomNbrPlace, R.IsAvailable, RT.ReservationType
from Reservation RS
inner join Customer C on C.CustomerId = RS.CustomerId
inner join Room R on R.RoomId = RS.RoomId
inner join ReservationType RT on RT.ReservationTypeID = RS.ReservationTypeId
Where RS.ReservationId = @ReservationId --and R.IsAvailable = 0
end
and this my Jquery code:
function BtnEdit() {
$('a.item-edit').on("click", function (e) {
e.preventDefault();
var $editedtr = $(this).closest("tr").get(0);
showloading();
var aData = $itemTable.fnGetData($editedtr);
$Id = aData[index];
PageMethods.GetReservationById(aData[index], function (response) {
var result = eval("(" + response + ")");
if ($('#<%=txtRoomName.ClientID%>').length > 0) {
$("#<%=txtCheckin.ClientID%>").val(new Date(result.reservationInfo[0].Checkin).toString());
$("#<%=txtCheckout.ClientID%>").val(new Date(result.reservationInfo[0].Checkout));
$("#<%=txtRoomName.ClientID%>").val(result.reservationInfo[0].RoomName);
$("#<%=txtRoomDescription.ClientID%>").val(result.reservationInfo[0].RoomDescription);
$('#ddlRoomType').val();
$('#ddlNbrePlace').val();
if (result.reservationInfo[0].IsDisplayed)
$('#<%=chkbTax.ClientID%>').trigger("click");
}
$('#pnlGrid').hide();
$('#pnlEntry').show();
hideloading();
});
});
}
El Dev
7-Mar-15 5:04am
View
yeah I have updated but now the value of textbox is "invalid date".
El Dev
7-Mar-15 4:48am
View
I am getting this error: ReferenceError: date is not defined
El Dev
24-Jan-15 5:47am
View
Hi Zoltan,
If you know any software I can buy, there is no problem, I can buy it if doest exists.
Please recommend me.
El Dev
17-Dec-14 3:33am
View
Ok thanks let me try that one.
El Dev
17-Dec-14 2:43am
View
could you give me a simple example when requesting data from a database.
incase there are no data and incase there are data using ajax.
And how to catch an empty response empty.
El Dev
17-Dec-14 2:10am
View
Yeah put is coming when there are no rooms(or data) coming from the database.
when there are rooms(data) coming from database.
that e is not appearing.
El Dev
17-Dec-14 2:00am
View
The error is coming when there are no available rooms coming from database.Means the response is null.
It is genereted from this line of the ajax response:
var rooms = response.d;
if ($.isEmptyObject(rooms)) {
alert("Room is not Available!")
El Dev
17-Dec-14 1:59am
View
Hi Eliyahu,
The error is coming when there are no available room coming from database.Means the response is null.
I think it is on this line of the ajax response:
var rooms = response.d;
if ($.isEmptyObject(rooms)) {
alert("Room is not Available!")
El Dev
17-Dec-14 1:44am
View
Deleted
Hi Eliyahu,
The error is coming when there are no available room coming from database.Means the response is null.
I think it is on this line of the ajax response:
var rooms = response.d;
if ($.isEmptyObject(rooms)) {
alert("Room is not Available!")
El Dev
20-Nov-14 23:56pm
View
Hi Aajmost,
I have tried both your way but none of them are working!!
This how I am doing but now it is generating an error saying that:
"Invalid attempt to call FieldCount when reader is closed."
public IEnumerable<roominfo> GetAvailableRoomByDate()//IEnumerable<t> is great for working with in-memory collections, but IQueryable<t> allows for a remote data source, like a database or web service.
{
using (SqlDataReader sdr = SqlHelper.ExecuteReader(SqlHelper.GetConnection(), "[GetRoomsByDate]", Checkin, Checkout))
{
if (sdr.HasRows)
{
while (sdr.Read())
{
bool res = false;
for (int i = 0; i < sdr.FieldCount; i++)
{
if (sdr.GetName(i).Equals(RoomNotAvailable, StringComparison.InvariantCultureIgnoreCase))
res = true;
sdr.Close();
}
if (res)
{
yield return new RoomInfo
{
RoomNotAvailable = Convert.ToString(sdr["RoomNotAvailable"])
};
}
else
{
yield return new RoomInfo
{
RoomId = Convert.ToInt32(sdr["RoomId"]),
RoomTitle = Convert.ToString(sdr["RoomTitle"]),
RoomName = Convert.ToString(sdr["RoomName"]),
RoomPrice = Convert.ToInt32(sdr["RoomPrice"]),
RoomDescription = Convert.ToString(sdr["RoomDescription"]),
};
}
}
}
}
}
El Dev
17-Nov-14 0:38am
View
I ashish_shukla,
It is not working, this is my full code:
///
/// Summary description for CarService
///
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class CarService : System.Web.Services.WebService {
public CarService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
public class product {
public string name { get; set; }
public string img { get; set; }
public string descr { get; set; }
public string Checkin { get; set; }
public string Checkout { get; set; }
}
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
[WebMethod]
public static string SaveData(string checkindate, string checkoutdate)
{
string str = checkindate + " " + checkoutdate;
//return str;
var serializer = new JavaScriptSerializer();
return serializer.Serialize(str);
}
}
El Dev
16-Nov-14 6:28am
View
what is the difference between consuming a webservice and calling aspx file.
In this exemple when calling an aspx file it is working but when consuming a webservice it is raising an error:
Unknown web method SaveData. Parameter name: methodName
This is my code:
$(function () {
var checkin = $("#datepickercheckin").val();
var checkout = $("#datepickercheckout").val();
$('#btnSearchAvailRoom').on("click", function () {
Greating();
});
});
function Greating() {
var query = "Default2.aspx/SaveData";
//var query = "CarService.asmx/SaveData";
$.ajax({
type: "POST",
contentType: "application/json;charset=utf-8",
url: query,
//data: '{ Name: "Daniel", SName: "Ndekezi" }',
data: '{ checkindate: "'+ checkin + '", checkoutdate: "'+ checkout +'" }',
dataType: "json",
success: function (data) {
$('#divtxt').text(data.d);
},
error: function (result) {
alert("error");
}
});
}
and this my code behind in the webservice or the aspx.cs file:
I am using the same method:
[WebMethod]
public static string SaveData(string checkindate, string checkoutdate)
{
string str = checkindate + " " + checkoutdate;
return str;
}
can u tell me the difference
El Dev
16-Nov-14 6:22am
View
Deleted
I do not able to see what is wrong in this example like when calling aspx it is working but when calling asmx file it is not working:
function Greating(checkin, checkout) {
//var query = "Default2.aspx/SaveData";
var query = "CarService.asmx/SaveData";
$.ajax({
type: "POST",
contentType: "application/json;charset=utf-8",
url: query,
//data: '{ Name: "Daniel", SName: "Ndekezi" }',
data: '{ checkindate: "'+ checkin + '", checkoutdate: "'+ checkout +'" }',
dataType: "json",
success: function (data) {
$('#divtxt').text(data.d);
},
error: function (result) {
alert("error");
}
});
}
and this my code behind the webservice:
[WebMethod]
public static string SaveData(string checkindate, string checkoutdate)
{
string str = checkindate + " " + checkoutdate;
return str;
}
Please can u tell me the difference between consuming a webservice and an aspx file?
El Dev
20-Oct-14 18:38pm
View
Hi Sergey,
This is my html & Jquery code:
<form id="form1" runat="server">
Artists
<div id="artists">
<div id="pageSize">
<label>Page size</label><br />
<select>
<option>10</option>
<option>25</option>
<option>50</option>
<option>100</option>
</select>
</div>
<table id="artistTable">
<thead>
<tr>
<th width="100">ArtistId</th>
<th width="200">Name</th>
<th width="400">ArtistImage</th>
</tr>
</thead>
<tbody id="artistList"></tbody>
</table>
<div id="loading"></div>
<div id="pager">
<ul class="pages">
<li class="pgEmpty">first</li>
<li class="pgEmpty">prev</li>
</ul>
</div>
</div>
<div>
</div>
<script src="Scripts/jquery-1.9.0.min.js"></script>
<script src="Scripts/jquery.pager.js"></script>
<script src="Scripts/jquery.tmpl.js"></script>
<script id="artistTmpl" type="text/x-jquery-tmpl">
<tr>
<td align="right" valign="top">${artistId}</td>
<td>${artistName}</td>
<td>${artistImage}</td>
</tr>
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#loading").hide();
var pageIndex = 1, pageSize = 10, pageCount = 0;
getArtists(pageIndex);
$("#pageSize select").change(function () {
pageIndex = 1
pageSize = $(this).val();
getArtists(pageIndex);
});
function getArtists(index) {
var query = "Handlers/Json.ashx?page_number=" + index + "&page_size=" + pageSize;
pageIndex = index;
$("#artistList")
.fadeOut("medium", function () {
$("#loading").show()
$.ajax({
dataType: "json",
url: query,
jsonp: "$callback",
success: showArtists
});
});
}
function showArtists(data) {
pageCount = Math.ceil(data.total_count / pageSize),
artists = data.items;
$("#pager").pager({ pagenumber: pageIndex, pagecount: pageCount, buttonClickCallback: getArtists });
$("#artistList").empty()
$("#artistTmpl").tmpl(artists).appendTo("#artistList")
$("#loading").hide().find("div").fadeIn(4000).end()
$("#artistList").fadeIn("medium")
$("#artistList tr").hover(
function () {
$(this).addClass("highlight");
},
function () {
$(this).removeClass("highlight");
});
}
});
</script>
</form>
And this the code from .ashx file:
<%@ WebHandler Language="C#" Class="Json" %>
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Web;
using System.Web.Configuration;
using System.Web.Script.Serialization;
//namespace TemplatingWithPagination
//{
public class Json : IHttpHandler
{
El Dev
5-Sep-14 10:04am
View
thanks!
El Dev
15-Apr-14 10:39am
View
Thanks!
El Dev
8-Apr-14 13:11pm
View
So what can I do?
El Dev
8-Apr-14 5:10am
View
Am still getting the same error(System.FormatException: The specified string is not in the form required for an e-mail address. at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName) at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset) at System.Net.Mail.MailAddressCollection.ParseValue(String addresses) at System.Net.Mail.MailAddressCollection.Add(String addresses) at Admin_newsletter.HtmlEmailTemplate() in d:\hosting\9780189\html\Admin\newsletter.aspx.cs:line 140)
this how I change the code as u said:
string[] recipients = new[] { "teke@gmail.com", "dan.jojo@gmail.com" };
DataTable dt = _UserInfo.GetUserAllByEmail();
string bccAddresses = "";
string Address = "";
mailMessage.From = new MailAddress("sales@gmail.com", "We have big Deals for you!");
mailMessage.To.Add("dan@gmail.com");
foreach (DataRow drRecipient in dt.Rows)
{
mailMessage.Bcc.Add(drRecipient["Email"].ToString());
}
mailMessage.Subject = "Test Email";
mailMessage.IsBodyHtml = true;
El Dev
5-Apr-14 5:55am
View
Hi Guruprasad! This is the value of bccAddresses: muhizi@gmail.com, josh@hotmail.com, etc
I can't list all the emails but this is what I am getting.
El Dev
4-Apr-14 13:19pm
View
Hi Guruprasad! I have updated my code as u said but am still getting an error.This the error I am getting:
System.FormatException: The specified string is not in the form required for an e-mail address. at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName) at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset) at System.Net.Mail.MailAddressCollection.ParseValue(String addresses) at System.Net.Mail.MailAddressCollection.Add(String addresses) at Admin_newsletter.HtmlEmailTemplate() in d:\hosting\9780189\html\Admin\newsletter.aspx.cs:line 141
The line 141 is here mailMessage.Bcc.Add(bccAddresses); in my code.
El Dev
4-Apr-14 12:49pm
View
u mean this "Just add a comma after each address in one string value and pass that to the Add() method." if yes please I do not understand how, please an exemple.
El Dev
4-Apr-14 12:43pm
View
ok what if I have thousands of emails, which is my case!!
mailMessage.Bcc.Add(drRecipient["Email"].ToString());
This how I am adding all the emails and send to them a newsletter.And please take a look to my query again, u can see that I have to separate with the commas. but this is limited to some user,is why I have remove the where clause.Just inorder to send to all the email from my db.
El Dev
4-Apr-14 12:29pm
View
Hi Richard I do understand but I ma trying to separate the emails with comma because without separating with a comma, it is giving the error I mentioned. I can remove that line of code and it will work perfectly but it will give that error mentioned above.
El Dev
27-Mar-14 3:48am
View
What? I am not getting you...Am working on my local server not web server!!
and I do not understand the code you post!
El Dev
27-Mar-14 3:42am
View
you mean like this <asp:TextBox ID="txtFirstName" runat="server">
<asp:RequiredFieldValidator ID="RFVtxtFirstName" runat="server" ControlToValidate="txtFirstName" InitialValue="0"
ErrorMessage="First Name is required" Display="Dynamic" Enabled="false" ValidationGroup="button">
<br />
<input id="btnSave" type="button" value="Save" class="send action-btn" ValidationGroup="button" />
if so it is still not working , I have tried it.
El Dev
26-Mar-14 16:17pm
View
I dont think it is a problem of code because the code work fine in other solution.
The Problem is this "Error: ASP.NET Ajax client-side framework failed to load."
How can I resolve this problem framework?
El Dev
23-Mar-14 6:44am
View
Hi OriginalGriff,
what is the difference between :
string PagePath = Path.GetFullPath(Request.Url.ToString()); and
string PagePath = Request.Url.ToString();
because when I am using string PagePath = Path.GetFullPath(Request.Url.ToString());
I am getting an error that says "URI formats are not supported." but when I am using
string PagePath = Request.Url.ToString(); am getting the full path means it is working fine.
El Dev
11-Mar-14 1:57am
View
And by the way take alook on this link u will understand what I mean: http://www.sitepoint.com/offline-web-application-tutorial/
El Dev
11-Mar-14 1:49am
View
Hi sergey! ok can u please suggest me what is the best way to build an application that can work online and offline if there is no internet.Is what I want to know if it is possible or not!!
El Dev
3-Mar-14 2:53am
View
Thanks vedat!
El Dev
3-Mar-14 2:38am
View
Hi Vedat, It is not populating the dropdownlist...This is the code am using:
UserTypeInfo _UserTypeInfo = new UserTypeInfo();
List<usertypeinfo> _UserTypeInfoList = _UserTypeInfo.GetUserType().ToList<usertypeinfo>();
ddlUserType.DataValueField = "UserTypeId";
ddlUserType.DataTextField = "UserType";
El Dev
22-Feb-14 6:14am
View
this can't be achieved? why and what about the full-Text search?
El Dev
22-Feb-14 5:05am
View
This how all the e-commerce work and it is good user experience(see amazon,ebay,Alibaba, etc...) all of them have a SearchBox in the header, and I dont understand why this is old.
El Dev
22-Feb-14 3:34am
View
Yeah but the user can enter it in a searchBox, this way the problem come again.
El Dev
21-Feb-14 10:17am
View
Hi Peter leow is there any way we can use this logic by searching in a table.Like for ex:
I have a table called Product, then I want to make a full text search so that I can get different expression like 'Lumia 520', 'Nokia lumia', 'Nokia 520' from the field (productName) which have 'Nokia lumia 520' as the full expression data.I get some suggestion to use a Search full-Text, while trying to create Full-Text Catalog ,Full-Text Index and then Populate the Index,I am getting this error: Full-text is not supported on this edition of SQL Server. (Microsoft.SqlServer.Smo).
El Dev
21-Feb-14 6:28am
View
Yes I see that it is displaying this: Yes it Contains "Hello%Joe" but this is not what I am loking for because I want it to display: Yes it Contains "Hello Joe"
El Dev
21-Feb-14 6:02am
View
Hi Mr. Fisher,
what if I want to type Hello Joe.Because if in my table I have a full productName Nokia lumia 520.Then someone like a customer type Nokia 520 instead of typing Nokia lumia 520 and the system should display the ProductName, right?Now this what i want to know.
El Dev
21-Feb-14 5:58am
View
This is doesn't work too.Any way let me explain my scenario very well I am working on a e-commerce and a customer may type Nokia 520.But in my table of products, the productName is Nokia lumia 520.In that wat the system will send to customer that the item doesnot exist.So I want to avoid this because a customer may type only nokia 520 instead of Nokia lumia 520 or lumia 520. so this the scenario I am facing and refer to that logic.
El Dev
15-Jan-14 18:22pm
View
it has only .txt extension not .txt.txt
El Dev
15-Jan-14 18:21pm
View
It is a website(or webform)...
El Dev
8-Oct-13 5:32am
View
Hi Padam!I am still facing a problem...what it I want a total running sum of the TotalDays.
try this code out and see what I mean:
SELECT a.[DateId], a.InstallementID, (SELECT SUM(b.InstallementID)
FROM [dbo].[Date] b
WHERE b.[DateId] <= a.[DateId]) as Summation
FROM [dbo].[Date] a
ORDER BY a.[DateId];
see the summation result, I want to get samething with the TotalDays field.
Please help fixing this.
El Dev
3-Oct-13 8:26am
View
am not getting what u are saying...Pliz give an example.or just give an idea or code on how can I charges 10% to someone if the total running sum of Dates is greater than 60 days.
El Dev
3-Oct-13 5:17am
View
Dates from above, look at my question again pliz!!I have shared the record that I have in my table.
I want to get running sum of Date like suppose if I am writing this query:
SELECT *, (SELECT (sum(b.[Id])))
FROM [dbo].[Date] b
WHERE b.[DateId] <= a.[DateId]) as SumId
FROM [dbo].[Date] a
ORDER BY a.[DateId];
this will run and will give me the running total of the Id like this:
DateId Date Id SumId
1 2013-06-01 00:00:00.000 1 1
2 2013-07-05 00:00:00.000 1 2
3 2013-08-08 00:00:00.000 1 3
4 2013-09-10 00:00:00.000 1 4
this is what am looking for Dates also.
so for the date I want to get the difference between the dates then get the running sum by day and charge 10% where the difference between dates is greater than 30 days.
El Dev
2-Oct-13 16:02pm
View
ok suppose I want to get the difference between Dates if the difference is greater than 30 days I need to charge 10% as interest.can u help me resolve this?
El Dev
2-Oct-13 15:56pm
View
I want to get running sum of Date like suppose if I am writing this query:
SELECT *, (SELECT (sum(b.[Id])))
FROM [dbo].[Date] b
WHERE b.[DateId] <= a.[DateId]) as SumId
FROM [dbo].[Date] a
ORDER BY a.[DateId];
this will run and will give me the running total of the Id like this:
DateId Date Id SumId
1 2013-06-01 00:00:00.000 1 1
2 2013-07-05 00:00:00.000 1 2
3 2013-08-08 00:00:00.000 1 3
4 2013-09-10 00:00:00.000 1 4
this is what am looking for...
so for the date I want to get the difference btween the date then get the running sum by day and charge 10% where the difference between dates is greater than 30 days.
El Dev
28-Sep-13 13:27pm
View
Thanks Asif!!!
El Dev
28-Sep-13 11:31am
View
I want to charge an interest to customers if the difference between 2 dates exceed 30 days...means if I give a customer a loan of $300 to be paid in 3 installment for $100,if the customer exceed 30 days he will star paying interest of $10 for each 30 days.
El Dev
28-Sep-13 5:58am
View
Thanks Asif!
El Dev
28-Sep-13 5:15am
View
Hi Andreas!
I tried to use literal inorder to hold the line break tag without using a table and it child control. this work fine but watever I am trying to use the table control it is not working...But what am wondering is forget the literal control and try to put a line break between rows.Because I want to enter an integer in my textBox and get generated textboxes in different rows not to a same row.
El Dev
11-Sep-13 9:12am
View
To be a server control it must have a runat='server' attribute I dont know what do u mean but
wherever I am putting the code it does not work means from
code behind:Table tb = new Table();
tb.ID = "tb1";
and
Html:<table id="tb1" runat="server"></table>
so nothing is working...
El Dev
11-Sep-13 8:45am
View
Hi dholakiya!Look how I am doing,I do not if you mean like this:
<div id="pnlDate" runat="server">
<table id="tb1" runat="server"></table>
</div>
But also this does not work...Please help fixing this I do not understand what is the problem
El Dev
11-Sep-13 6:31am
View
so what does this code mean:
Table tb = new Table();
tb.ID = "tb1";
I am generating the table dynamically.
and why it is working as normal in a webForm with the same code, please try it and see what I mean...
El Dev
11-Sep-13 6:09am
View
so where do you want me to put this and why it is working on a page which doest not inherit a masterPage...try it and you will see that is working on a simpler webForm.
El Dev
11-Sep-13 6:07am
View
I Neema Derakhshan! I have put the code out of the loop but it is still giving me the same error...
El Dev
10-Sep-13 9:09am
View
please can u show me by using my code, I have never used the delegate function.
This how I am using inside my code:
<script type="text/javascript">
$(function () {
$(".myDates").delegate(function () {
$(this).datepicker();
});
});
</script>
I dont know if it is like that but it is not workin also,I have even tried to use the script block inside update panel.Please help on that...
El Dev
10-Sep-13 8:57am
View
Hi, I have tried using the link but is it is not working...
El Dev
6-Sep-13 6:44am
View
Thnks!
El Dev
6-Sep-13 6:19am
View
Hi Harshil_Raval
How can I get the values with javascript, please help by using my logic...
El Dev
20-Aug-13 13:22pm
View
Thanks Mahesh it is working....
El Dev
20-Aug-13 13:07pm
View
I have a question Mahesh...
I have followed an example from codeproject, the way they are connecting to the db is different as the way I am usually connecting to db and it is the first time I saw that way.
This is the way they are connecting to db:
string connectionString = "server=localhost;uid=sa;pwd=M77;database=TestDB;";
Once I am connecting with string connectionString = "server=localhost;uid=sa;pwd=M77;database=TestDB;"; I am getting this alert error from browser:
The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <servicedebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.
what is the problem?
El Dev
20-Aug-13 13:03pm
View
Still not working I did how you have corrected, this how I did:
function OnGetProductDetailsByProductIDComplete(result) {
var prod = eval("(" + result + ")");
$("spnProductID").text = prod.ProductID;
$("spnProductName").text = prod.Name;
$("spnProductNumber").text = prod.ProductNumber;
}
El Dev
19-Aug-13 6:04am
View
asp.net
El Dev
18-Jun-13 12:07pm
View
Thanks Zafar sultan!it works...
El Dev
18-Jun-13 11:26am
View
I've tried your code but nothing changed,still the picture is moving somehow.
El Dev
18-Jun-13 10:58am
View
yes Zafar,I understand but when I am applying the style to the div...it is like the div is moving,I dont know how to explain that.But the purpose is to wrapper the image inside that div and this element must be fixed nothing need to be like moving what.Please test this you will see that.The css code you are comment out is where is the problem.I need that border style.Thanks!
El Dev
18-Jun-13 10:40am
View
Did you check my code,it is like moving somehow when I mouse hove I want it to be fixed.The image inside.
El Dev
4-Jun-13 6:56am
View
Bernhard,I am the admin of the web server.Please need some idea from u.
What I am doing is export a pdf file for more than one order detail but the the name of the pdf file is not changing but the content change depend of the order selected by the user it is called OrderDetails.pdf
Now my kestion is Do I need to upload that file in live also.Because in my local I can export and my local system allow me to open that file.But not in live.
El Dev
4-Jun-13 6:15am
View
I am not using any folder.This is the my code to export the pdf.
protected void ExportPDF_Onclick(object sender, EventArgs e)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=OrderDetails.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter tw = new HtmlTextWriter(sw);
this.Page.RenderControl(tw);
StringReader sr = new StringReader(sw.ToString());
Document Orderpdf = new Document(PageSize.A4, 10f, 10f, 0f, 0.0f);
HTMLWorker htmlparser = new HTMLWorker(Orderpdf);
PdfWriter.GetInstance(Orderpdf, Response.OutputStream);
Orderpdf.Open();
htmlparser.Parse(sr);
Orderpdf.Close();
Response.Write(Orderpdf);
Response.End();
}
I dont need to upload this file.
El Dev
4-Jun-13 6:13am
View
Deleted
I am not using any folder.This is the my code to export the pdf.
protected void ExportPDF_Onclick(object sender, EventArgs e)
{
//Export HTML table to PDF link:http://forums.asp.net/t/1835616.aspx/1
// another link:http://www.dotnetspider.com/forum/324075-How-export-HTML-table-pdf-with-exact-format-using-iTextSharp.aspx
Response.ContentType = "application/pdf";
// Write response to client
Response.AddHeader("content-disposition", "attachment;filename=OrderDetails.pdf");
//About Proxy to help understand Response.Cache.SetCacheability(HttpCacheability.NoCache); http://en.wikipedia.org/wiki/Proxy_server
Response.Cache.SetCacheability(HttpCacheability.NoCache);//The following code example demonstrates how to set the Cache-Control header to the enumerated value for no-cache.
StringWriter sw = new StringWriter();//write the output to the string
HtmlTextWriter tw = new HtmlTextWriter(sw);//write the individual HTML markup for all the control(s) contained in the control.
this.Page.RenderControl(tw);//Call the control's RenderControl() method so we finally can get the HTML markup.
StringReader sr = new StringReader(sw.ToString());
Document Orderpdf = new Document(PageSize.A4, 10f, 10f, 0f, 0.0f);//10f(put the margin of 10 on left and right).100f marin on the top,
//FontFactory.GetFont("Tahoma", 40, iTextSharp.text.BaseColor.BLUE);
HTMLWorker htmlparser = new HTMLWorker(Orderpdf);//is a very simple HTML parser, since iText[Sharp]'s specialty is PDF, not document conversion.
PdfWriter.GetInstance(Orderpdf, Response.OutputStream);
Orderpdf.Open();
htmlparser.Parse(sr);
Orderpdf.Close();
Response.Write(Orderpdf);
Response.End();
}
El Dev
1-Jun-13 18:46pm
View
Thanks Christian Graus...let me try it.
El Dev
1-Jun-13 18:30pm
View
Christian Graus you mean,using JQuey and Ajax can populate a second dropdownlist depending of the a dropdownlist selectedindexchanged from database because the data are coming from my database?
El Dev
1-Jun-13 18:13pm
View
You mean there is no way to handle this asp.net.
And Please can u give me same code using Ajax and Jquery,I already know about this but I have never try to populate a dropdownlist with data from database and cause the another dropdownlist to be populate depending on the first one.Please if you have a link or any code,Provide it will be helpfull.
El Dev
1-Jun-13 12:14pm
View
you mean editor page(html page)??
El Dev
31-May-13 10:31am
View
actually there is no error,but it is not displaying in the browser.ok help by verifying if there no logic error...
El Dev
31-May-13 5:12am
View
What if I do not want to upload the file but to save it automatically while exporting it.
El Dev
31-May-13 5:03am
View
There is no way to automatically save it without uploading?
El Dev
23-May-13 9:01am
View
Thanks!
El Dev
23-May-13 6:56am
View
I dont need them in GridView I can create the in code behind Like this
TextBox textCompanyName = (TextBox)row.Cells[0].Controls[0];
and this work fine but when I am using this Label lblCountry = (Label)row.Cells[4].Controls[0]; it is not working...
El Dev
7-May-13 12:10pm
View
Ok Sergey,suppose a company is sending an xml string via my webservice(means is consuming my webservice) how can I capture that xml string and then response to it, without testing it into a textbox?
Please let me know if I need to clarify this again.
El Dev
7-May-13 11:58am
View
Actually a company will be sending this xml string via my webservice as a post method if I can say that because because data will not be passed in the url.
The scenario is I have give the company my link(a webservice link or url) then what they will do with my link or url is to send the xml string via it, and I think to test if it is working I need to passe the xml string into that textbox.Please if you think this a wrong way please give details on this because I have spending alot of time working on this but no answer.Best Regards!
El Dev
7-May-13 11:41am
View
Actually a company will be sending this xml string via my webservice as a post method if I can say that because because data will not be passed in the url.
The scenario is I have give the company my link(a webservice link or url) then what they will do with my link or url is to send the xml string via it, and I think to test if it is working I need to passe the xml string into that textbox.Please if you think this a wrong way please give details on this because I have spending alot of time working on this but no answer.Best Regards!
El Dev
7-May-13 11:34am
View
I am getting trouble by adding tag while replying to your question but I have ask down the same question.Please let me know if you got it or not.
El Dev
7-May-13 11:32am
View
Deleted
I have a webservice,in that webservice class I have a method that I will invoke,then after invoke it I will pass an xml string into a textbox as you enter value into a textbox.or when trying to add 2 integer using a webservice,same logic
this is the xml string,I am entering into that textbox:
<command>
<type>PAYMENT
<companyname>Gemeya
Then what I need is to load this xml string as it is into xml file that I have into my project.
El Dev
7-May-13 11:30am
View
Deleted
have a webservice,in that webservice class I have a method that I will invoke it,then after invoke it I will pass an xml string into a textbox as you enter value into a textbox.or when trying to add 2 integer using a webservice,same logic
this is the xml string,I am entering into that textbox:
<command>
<type>PAYMENT
<companyname>Gemeya
Then what I need is to load this xml string as it is into xml file that I have into my project.
El Dev
7-May-13 11:26am
View
Deleted
have a webservice,in that webservice class I have a method that I will invoke it,then after invoke it I will pass an xml string into a textbox as you enter value into a textbox.or when trying to add 2 integer using a webservice,same logic
this is the xml string,I am entering into that textbox:
<command>
<type>Order<type>
<company>A<company>
Then what I need is to load this xml string as it is into xml file that I have into my project.
El Dev
7-May-13 11:02am
View
I have a webservice,in that webservice class I have a method that I will invoke it,then after invoke it I will pass an xml string into a textbox as you enter value into a textbox.or when trying to add 2 integer using a webservice,same logic
this is the xml string,I am entering into that textbox:
<command>
<type>PAYMENT
<companyname>Gemeya
Then what I need is to load this xml string as it into xml file that I have into my project.
El Dev
7-May-13 10:45am
View
Ok Please can you suggest me a better way,If I am entering an xml string into a textbox.How can I load it?
El Dev
7-May-13 10:42am
View
There is no other way without using LINQ,I am not good in LinQ.
If possible why not just show the code to add to my Logic.
El Dev
6-May-13 14:35pm
View
Why not xml?And please can u explain to me the scenario...I think the scenario will be very helpfull.
El Dev
6-May-13 14:33pm
View
Yes!
El Dev
6-May-13 8:51am
View
Thanks!!!
El Dev
27-Apr-13 10:49am
View
let me try...Thanks!
El Dev
27-Apr-13 10:14am
View
But I do not understand this kind of error because I am testing if the valuepair is equal to "error" then display that error by assigned the text to the label.why I got that error?I can see the response contains error value in the data it is sending.Do you think this should be an error?
El Dev
27-Apr-13 9:42am
View
Ok please help me for this scenario I am getting a response from a server which is send me data after sending a request and inside the collection of data it is sending I have to check it there is value that is equal to "error" if so I have to reply to the user the error message that I want to pass to the label control:
protected void PerformSale()
{
MRequestMessage request = new MRequestMessage();
MResponseMessage response = new MResponseMessage();
Dictionary<string,> rf = request.RequestFields;
rf.Add("mp_NameOnCard", "Dave R.");
rf.Add("mp_CardNumber", "41111111111111");
MHttpPost.PerformTransaction(request, response);
ShowParameters(request, response);
}
this where I am calling the method ShowParameter
El Dev
27-Apr-13 9:03am
View
yes it is on the page:this is it
<asp:Label ID="msgError" runat="server">
El Dev
20-Apr-13 9:36am
View
but what if I want to control it in admin like whenever I upload an item in the database with the admin right,I can also check if the button buy can be visible or not to the user depending of the item.
El Dev
11-Apr-13 10:02am
View
By the way Raje.
Please can u explain to me this line of code :
Label lbl = (Label)row.FindControl("lblStatus");
do we instiate a label or I am declaring lbl?
El Dev
11-Apr-13 9:41am
View
Thanks Raje_4.8K!it works....
El Dev
9-Apr-13 16:22pm
View
I have changed like that but I am getting this error:Procedure or function 'SearchTestName' expects parameter '@TestName', which was not supplied.
This how I have changed:
c# code:
SqlDataAdapter adapter = new SqlDataAdapter();
DataTable ds = new DataTable();
try
{
SqlCommand sqlcom = new SqlCommand("[SearchTestName]", sqlcon);
sqlcom.Parameters.AddWithValue("@TestName", 50).Value = txtSearchTestName.Text.Trim();
adapter.SelectCommand = sqlcom;
adapter.Fill(ds);
labelSearch.Text = "Data Found!";
Response.Redirect("ConnectionString.aspx", true);
}
catch (Exception ex)
{
labelSearch.Text = ex.ToString();
}
El Dev
26-Mar-13 4:28am
View
no it is not like this I want...what I mean is to test the incoming xml file not validate it...because I can see that my xml file is working.the scenario is I am communicating with another application and they are sending an xml file to my server but I cannot see what they are sending.
El Dev
12-Mar-13 2:48am
View
it is not also working...Is a problem of my vs 2010?
El Dev
11-Mar-13 9:15am
View
Yes I have tried all the version using this link http://www.nuget.org/packages/EntityFramework/
El Dev
8-Mar-13 11:43am
View
no Clientidmode attribute for the button control...
El Dev
8-Mar-13 7:52am
View
I have changed but still not working
this is how:
$('#btnContinue').click(function(e) {
if ($("#<%=rdoYes.ClientID %>").attr('checked', 'checked'))
e.preventDefault();
});
El Dev
6-Mar-13 7:01am
View
This is quite confusing,the answer your are giving me.please need your assistance:
Here is how I am doing
public void ProcessRequest (HttpContext context) {
UserCartInfo _UserCartInfo = new UserCartInfo();
context.Response.ContentType = "application/json";
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
HelperFunctions.InitializeCulture();
HttpCookie cookie = new HttpCookie("ShoppingCart");
cookie.Value = Convert.ToString(context.Request["ProductId"]);
cookie.Value = Convert.ToString(context.Request["Quantity"]);
cookie.Expires = DateTime.Now.AddDays(7);
var result = new
{
Success = _UserCartInfo.AddToCart() == 1 ? false : true,
};
var json = serializer.Serialize(result);
context.Response.Write(json);
}
I am stack here.What next I have to do please can u be more specifik...
El Dev
6-Mar-13 6:34am
View
ok,Please can u help on how I can store the items in the cookies because I was using this code to do the job by using JSON,like this:
public void ProcessRequest (HttpContext context) {
//if ((HttpContext.Current.Session["UserId"] == null)|(HttpContext.Current.Session["UserId"] != null))
//{
UserCartInfo _UserCartInfo = new UserCartInfo();
_UserCartInfo.ProductId = Convert.ToInt32(context.Request["ProductId"]);
_UserCartInfo.Quantity = Convert.ToInt32(context.Request["Quantity"]);
_UserCartInfo.UserId = Convert.ToInt32(HttpContext.Current.Session["UserId"]);
_UserCartInfo.ipAddress = Convert.ToString(HttpContext.Current.Session["mycookie"]);
context.Response.ContentType = "application/json";
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
HelperFunctions.InitializeCulture();
var result = new
{
Success = _UserCartInfo.AddToCart() == 1 ? false : true,
// Message = _UserCartInfo.AddToCart() == 1 ? "Cannot add your own product" : "Added to cart"
};
var json = serializer.Serialize(result);
context.Response.Write(json);
//}
}
as u see I am getting the info and insert it into a db but as u said this is not a better,
now what I want is that code by using cookies.How to perform that using cookies.
El Dev
6-Mar-13 6:20am
View
am I need to store the cookies in the db as you see the idea I am using to store the data in the db using ip address.I have visited the link you send me but I do not understand hw should I associate it to the shopping cart I have while adding items.
El Dev
6-Mar-13 5:57am
View
ok I have changed the code now to get ip address I am using this code bellow,and it is working:
private string GetIP()
{
HttpRequest request = base.Request;
//Get UserHostAddress property
string address = request.UserHostAddress;
//write to response;
return address;
}
But as I am working on e-commerce website,you know that if I am adding items in the cart the system must know that this pc has added something.the problem is this when I go to another machine I can see what I have add,while machine are different. and when I add item in the cart by using different pc,I can see that Ip address are same of those machines in my db.Please can u give me an idea on how e-commerce work when a user add something in the cart...because shopping cart are different.Means if I am using another machine I can not see what the other user have added.
Help on that
El Dev
1-Mar-13 4:36am
View
Ibrahim,means I have to remove the html div,,ul,li,link from html code editor to code behind or I can leave the code there and add the html code in code behind...need more explanation on this.Please show me the code html and cs(by specifying like what you will put in html is this and what u will put in cs is this).thanks
El Dev
21-Feb-13 10:50am
View
Thnks its works but last thing is there any way to prevent a duplicate random number.
El Dev
19-Feb-13 8:41am
View
ok tell me do you think the way I am coding is wright because I have already test everything and I do not see what is the problem.
El Dev
19-Feb-13 8:38am
View
Deleted
<command>
<type>PAYMENT
<companyname>gemeya
<customerreferenceid>910573404
<msisdn>msisdn
<amount>45150.00
<txnid>
<status>
this is xml content
El Dev
19-Feb-13 8:37am
View
Yes is why I am asking I want to compare the data send through webservice then test with the data from db.
I can test my sp like this:
DECLARE @return_value int
EXEC @return_value = [dbo].[GetCheckoutInfoTest]
@Refcode = N'474879444',
@Amount = N'699150.00'
SELECT 'Return Value' = @return_value
and it is working but when I am sending this xml
<command>
<type>PAYMENT
<companyname>gemeya
<customerreferenceid>910573404
<msisdn>msisdn
<amount>45150.00
<txnid>
<status>
it is giving that error...Please help fixing this you can even check my webservice at this url:http://gemeya.com/Webservice.asmx?op=COMMAND and enter the xml content.
El Dev
19-Feb-13 8:26am
View
I have already step inside.it returning no data in datatable while there is data in the checkout table
El Dev
4-Nov-11 14:33pm
View
Please can you help me by telling what I need to send an sms to the database using a mobile device through ozeki.
Show More