|
bigphish wrote: Convert.ToBoolean(dt_GetCurrentPeriod.Rows[0]["IsCurrentPeriod"].ToString())
Error is raised if the converted string value of dt_GetCurrentPeriod.Rows[0]["IsCurrentPeriod"] is not a 'true ' or 'false '. Anything other then them would raise that error.
Try something like this:
if(dt_GetCurrentPeriod.Rows[0]["IsCurrentPeriod"] != null)
{
if(Convert.ToBoolean(dt_GetCurrentPeriod.Rows[0]["IsCurrentPeriod"].ToString()) == true)
{
}
}
|
|
|
|
|
hi..,
if,
dt_GetCurrentPeriod.Rows[0]["IsCurrentPeriod"] is 'false' also its giving error..It is working fine only if "IsCurrentPeriod" is true..
If the field is null its taking as false and giving error.I made this as nullable column.
|
|
|
|
|
ANY UPDATE ON THIS?
nothing is working for me..
|
|
|
|
|
bigphish wrote: how to check for null or false
To check for null...
if (dataRow.IsNull("ColumnName"))...
To check for false...
if (!Convert.ToBoolean(dataRow["ColumnName"]))...
|
|
|
|
|
Sir,
I am working on a login form on ASP.NET/C#.
I have everything working in the Visual Studio's integrated web server.
I setup a role named "Administrators" and configured a user with a username and password in the ASP.NET's WebSite Administration Tool. I got everything working fine under Visual Studio.
But when I deployed the web application and went to IIS, the login form is not working. The pages are properly loading but when I pressed the Login button, the login page shows a login fail as part of the login control.
I shall be much thankful to you if you kindly download the 180KB project files(no database dependancy) and try this out in IIS v5 and please suggest me a solution.
I used the following details when I used the WebSite administration tool of ASP.NET
role name : Administrators
username: admin
password : bookshop!
I want the login working fine under IIS.
Help me urgently , I am in the middle of my academic project.
PLS DOWNLOAD THE PROJECT FILES FROM THE LINK BELOW (only login part included)
http://sherin2701.googlecode.com/files/login_test.rar[^]
|
|
|
|
|
1) No one is going to download you project files
2) Giving username and passwords is just plain idiotic
3) This is your project and I'm sure the goal your teacher had in mind was for you to figure it out.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
This is where we post doubts. I am new to this.
Doubts are consequence of ignorance.
Ignorance makes me to say idiotic things. It was so disappointing.
Help me plz
|
|
|
|
|
Just another please-feed-me-here's-my-spoon kid.
|
|
|
|
|
Hi Everyone,
There is a problem that I'm facing w.r.t the datepicker in JQuery (.net 4.0).
I'm creating a clone of the existing row on add-button click. The existing row has two textboxes for editing(datepicker), add-button, remove-button.
On click of add-button, a row is appended (parent row is cloned). Cloning is done using following code (For cloned row there is no add-button):
var newFromDateInput = $("<input />").attr("class", removedFromDateInput.attr("class"))
.attr("id", removedFromDateInput.attr("id"))
.attr("name", removedFromDateInput.attr("name"))
.removeClass("hasDatepicker");
var newToDateInput = $("<input />").attr("class", removedToDateInput.attr("class"))
.attr("id", removedToDateInput.attr("id"))
.attr("name", removedToDateInput.attr("name"))
.removeClass("hasDatepicker");
removedFromDateInput.after(newFromDateInput);
removedToDateInput.after(newToDateInput);
removedFromDateInput.remove();
removedToDateInput.remove();
InitializeDatePickers();
The code for InitializeDatePickers() is as follows:
function InitializeDatePickers() {
ConsoleLog();
var maxDate = $("#model_BenefitPeriodEndDate").val();
var minDate = $("#model_BenefitPeriodStartDate").val();
$(".datePicker").datepicker({
onSelect: function(dateText, inst) {
MarkRecalculateThisBenefit(this);
},
maxDate: new Date(maxDate),
minDate: new Date(minDate),
changeMonth: true,
changeYear: true
});
ApplyDatePickerTextBoxKeyPress(".datePicker");
}
Problem faced: While editing the dates for cloned row using datepicker, the datepicker is updating the parent row instead of cloned row.
Thanks.
|
|
|
|
|
hi friends...
i developed one site ,design is gud in mozilla...where as in google crome and safari the design is changing,means everything extending ....
Txs in adivance
Supriya.
|
|
|
|
|
|
Hi
how to get no of month between 2 dates iin c#
Thanks ,
Amit
|
|
|
|
|
|
thanks ,
I have created my own logic
int monthsApart = 12 * (DateTime.Now.Year - startDateTime1.Year) + DateTime.Now.Month - startDateTime1.Month;
i hope this will help others
Thanks
|
|
|
|
|
Great. How long did you spend creating something that already exists? Why not learn to use the tools you have.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi iam using asp.net with c#
in my form there is file upload control to browse and get the image and there is dropdownlist control from which i have to select the items ,
on selecting the items from dropdownlist onselectedindex changed event ,the file upload control is becomming empty how to handle this situation
can you give example which helps me
|
|
|
|
|
Do you set the value of the dropdownlist in (for example) the OnLoad event?
if (!IsPostback)
{
}
|
|
|
|
|
You can place the dropdown list and the control you want to change onselectedindexchanged in update panel control, but place the upload control outside the update panel.
it will surely work for you.
|
|
|
|
|
thanks for the code project team .....
this logic helps me
|
|
|
|
|
selected indexchange event fires twice when selection changes i.e one event for deselecting the previous item and other for selecting the new item.
you may be refreshing the fileupload control in selected index change event,if so,make sure file upload path is empty before refreshing.
|
|
|
|
|
Hi All,
I have got this date 4/1/2010 12:00:01 AM from my text box and i converted it into the Date time (this date is April)
i know the today date time using Datetime.now
So i want all end date of month in the following format
30 Apr
31 May
thanks
amit
|
|
|
|
|
You must specify a date format you want to use to display the date.
This should do the trick :
DateTime.Now.ToString("d MMM yyyy hh:mm:ss");
|
|
|
|
|
following will displat the last date of the present month.
day(DateSerial(Year(datetime.Now), Month(datetime.Now), 0))
|
|
|
|
|
You can use DateTime.Now.Month to return an int representation of the month. You can pass this to a function to switch on for the month name, IE:
switch(month)
{
case 1:
return "January";
case 2:
return "Feburary";
}
|
|
|
|
|
Hi all,
In my application i am displaying Amount field in a grid view. which is money type in data base.my problem is when i m displaying it,it shows 4 numbers after decimal like ('45.0000').but i want to display only 2 places after decimal ('45.00').In sql query analyser it shows correctly.I have already used round function but still it is not working.
Any suggestions?
|
|
|
|