|
|
Hi
i have a webPage to display some values which come from database. some fields in my database have money dataType, hence it displays in textBox like this :
61.00000
my question is that how to format this value ? for exmaple i want to display it like this :
61 or 61.00
any help would be great appreciated.
Thanks
|
|
|
|
|
Hi, hdv212, there are 2 ways of doing this
One way is done at the database side. Use the convert function to convert your values to 2 decimal places before it is being passed to your asp.net webpage
For example:
use Test2
select Convert(decimal(7,2),moneyPrice) from test1 where id=1
Another way is to use casting in asp.net :
assuming variable x is your 61.00000
double y = (int)x - x
if (y !=0)
{
int decValue = (int)y*10 ;
double backToDecimalPlaces = (double)decValue/10;
x +=backToDecimalPaces;
}
|
|
|
|
|
|
Hi,
I have bound a gridview to sqltable , the gridview shows all messages stored in table. I want to add a checkbox to gridview so that multiple msgs can be selected and then delete btn should delete all the selected ones. I want to add this functionality to existing gridview . Plz provide help in this regard
thanx
|
|
|
|
|
|
Thanx alot.
I liked the articles alot.
Thankyou again
|
|
|
|
|
Nice to know it helps you.
|
|
|
|
|
Now i am having a new problem. The gridview doesn't display select btn now and i want the gridview to show details when select btn is clicked. How do i add a select to the grid view so that when clicked the details for msg are loaded in same page or another.
Thanx in advance
|
|
|
|
|
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:CommandField ShowSelectButton="True" />
</Columns>
</asp:GridView>
And use OnSelectedIndexed Change Event, Read the Gridview Row, Read the Row in GridViewRow Class and then Display the data where you want.
Hope this will help you. Let me know if any other issue.
Thank you!!
|
|
|
|
|
oh, thanx again, actually, i was using
<asp:buttonfield>
but i didn't notice that i mistakenly assigned it to the <itemtemplate> and hence e.commandargument was "" in grid_RowCommand event.
anyways, i realized this and was about to inform u. thanx for all ur help
|
|
|
|
|
From the questions you have been asking you are obviously quite new to ASP.NET and development in general. You would do well be grabbing a book or two on ASP.NET and reading them before continuing.
only two letters away from being an asset
|
|
|
|
|
Hi,
i have grabbed an asp.net book but i couldnt find any help on how to add custom checkbox to gridview such that the checkbox could be checked/unchecked to select some number of rows out of gridview.
Sorry for inconvenience and if you know a better book in which i can find help on such problems, please lemme know the book title and author and i will buy that too.
Thankyou
|
|
|
|
|
Dear one and all,
My grid view looks as follows
Course name Course Id Faculty Select User
-----------------------------------------------------------------------
ASP Asp101 XYZ Edit/Assign |
-----------------------------------------------------------------------
C# C#101 ABC Edit/Assign |
------------------------------------------------------------------------
and so on
What i need is when i click on assign i will redirect to another page there i will display all student names in a grid view as follows
Student name Student Email Registered Courses Options
-------------------------------------------------------------------------------- Abc abc@gmail.com reg Checkbox
------------------------------------------------------------------------------------
Abc abc@gmail.com reg Checkbox
------------------------------------------------------------------------------------
and so on ..
For this i need to write
|
|
|
|
|
Are you using a HyperLinkField column for the amend link?
|
|
|
|
|
|
Can i have this in English please...
|
|
|
|
|
I am working on a project. In the generated page HTML of my ASP.NET page, I have text boxes that have onchange events that link to javascript functions that link to Ajax PageMethods which goes to my SQL command texts.
For 3 of the 4 cases, my update process works. The only one that isn't working is my "template name" section. Basically, the template name is automatically generated upon the first creation of a record. The page displays this name in the editable text box. My boss gave me an SQL stored procedure that takes the OLD name and the new name. The new name is no problem.
My question is how do I save/recall the old name? I am fairly new at all this. He explained something about a hidden text field, and I found in the code this:
ret &= "<input type=""hidden"" id=""oldtemplatename"" value=""" & templatename & """/>"
This is the generated code. What I believe it is doing is saving the templatename (this is the one that will be changed) into this hidden input field with id oldtemplatename. I don't know what to do to get this variable to my other VB function that gets called through the javascript.
Does anyone follow? Please help
|
|
|
|
|
Use Request.Form["oldtemplatename"] to retrieve it, either that or change the text box to an ASP HiddenField control.
|
|
|
|
|
Hi all,
I want to get conversion of this format 'Mon Jun 08 15:19:42 CEST 2009' to DateTime type.
I explain the problem i'm reading from RSS feed but some of them bring that format of datetime, so my code
m_pubDate = Convert.ToDateTime(DirectCast(xNode.Element("pubDate").Value, String))
Broke for RSS Feeds that bring that format and i'm not able to convert this to DateTime.
Thank you for help
|
|
|
|
|
Post the date what you are getting through the RSS field and do you get any errors while conversion ?
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
this is the day 'Mon Jun 08 15:19:42 CEST 2009'
and the error i have is while doing Convert
|
|
|
|
|
try this plz[^]
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
i have used webparts in my application where the data is stored in the app_data...now iam having users where their data abt username and password are there in sql server 2005 how can i implement personalisation on for the users ...any examples related sql server 2005 and oracle personalisation
Thanks in advance
|
|
|
|
|
hi Friends,
I want to generate options available for login id like Gmail, yahoo when the desired login id not available.
Is there any way to do this ?
|
|
|
|