|
I am taking a average of a score and want to show it in a data grid, as a percentage value, below is a query, How do i represent this as a percentage value in a data grid.
right now i am getting it as a decimal value, ex(0.98,0.80)
select Manager_Name, avg (KC_Score) as score from dbo.KC
group by Manager_Name
Please advice....
NvN
|
|
|
|
|
Multiply your decimal value by 100. Hey presto, it's now a percentage!
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
the value is in decimal format ex-0.90,and i want to show it as 90%,
i don’t think Multiplying with 100 solves my issue.
NvN
|
|
|
|
|
0.90 * 100 = 90. Stick a % sign on the end and voila - you've got '90%'.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi all
i have page load usercontrol
Control cul = null;
switch (strParam)
{
case "viewcategoryproduct":
cul = LoadControl("admin/uc_CategoryPro.ascx");
break;
}
divbody.Controls.Add(cul);
But when i load usercontrol so the function page_load always run 2 time. I dont understand
And into my usercontrol have 2 dropdownlist
the fist dropdownlist have property is AutoPostBack="True" OnSelectedIndexChanged="ddlNews_SelectedIndexChanged"
the second dropdownlist will load data when ddlNews_SelectedIndexChanged
and button
but have problem
when i SelectedIndexChanged the fist dropdownlist so the second after load data
after that i click button but in CodeBehind it continue run to the event ddlNews_SelectedIndexChanged
????
some body tell me why
|
|
|
|
|
sir ,
I am faced problem that datasource does not support server side data pagging when using datareader with gridview.
thanks
|
|
|
|
|
I have a column in a report which displays an amount of currency. The currency is stored in sqlserver databse as 'Money' data type.
My problem is when I run the report it rounds off the value and does not disply to any decimal places. I want it to display the currency as 2 decimal places as this is how it is input and stored in the database.
anyone know how to do this?
macca
|
|
|
|
|
You haven't explained which reporting tool you are using. However the .NET syntax to format a number to 2dp would be something like mynum.ToString("N2") .
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I have enabled paging in my datgrid but when I click on page 2 I get the following Error message:
The GridView 'DateGrid' fired event PageIndexChanging which wasn't handled.
Anyone know what code I need to handle this?
Thanks,
macca
|
|
|
|
|
In your DataGrid1_PageIndexChanged event write:
this.DataGrid1.CurrentPageIndex = e.NewPageIndex;
this.BindDataGrid( );
Note:BindDataGrid is just to bind the grid with datasource.
|
|
|
|
|
Yesterday I asked a question on how to retrieve a string of the raw html. Now the problem is that I have changed the data to byte[] and need to write it back to the HtmlTextWriter. The following is a code snippet if I am sending it to a Response value and not a text writer.
<code>
byte[] binBytes = null;
StringWriter str = new StringWriter();
HtmlTextWriter html = new HtmlTextWriter(str);
base.Render(html);
string s = str.ToString();
binBytes = binConverter.ConvertString(s);
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.Clear();
Response.AddHeader("Content-Type", "binary/octet-stream");
Response.AddHeader("Content-Disposition",
"inline; filename=ConversionResult.bin; size=" + binBytes.Length.ToString());
Response.Flush();
Response.BinaryWrite(binBytes);
Response.Flush();
Response.End();
writer.Write(s); // Writer is the original HtmlTextWriter passed to the Render function
</code>
This snippet creates will creates a second window without and leaves the original window blank. I want to do away with the second window and have it create the modified text in the original window. So the question is how can I change the reply header information from the original encoding format and assign it to a new format (text to binary)?
Thanks,
Leo
Leo T. Smith
|
|
|
|
|
Hi,
Is it possible to validate whether the given SessionID is valied or not? or in other words how do we identify whether the session is still active or not? for a given session id?
Thanks in advance
bikash
|
|
|
|
|
Any session id is valid as along as its in session. You can use the Session start event and session end event to do stuff and use the Session.IsNewSession to check within your pages if the session is new and redirect to the default page etc...
|
|
|
|
|
Hello Everyone,
Can anybody let me know how to "Edit" a record in GridView and also how to give a "CommandName" to a "Edit" button......................
|
|
|
|
|
Right click the GridView --> Properties then click the event tab, then double click the RowEditing column; This will create an event for editing.
HTML
<br />
<br />
"<"asp:GridView ID="GridView1" runat="server" OnRowEditing="GridView1_RowEditing" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"">"<br />
"<"Columns">"<br />
"<"asp:CommandField ShowEditButton="True" /">"<br />
"<"/Columns">"<br />
"<"/asp:GridView">"<br />
<br />
"<"/code">"<br />
<br />
Code Behind<br />
<code><br />
<br />
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)<br />
{<br />
<br />
}<br />
<br />
|
|
|
|
|
Hi,
Hope every one is fine. I am using ASP.NET 1.1 and SQL Server 2000. Initially i was using database which was located on vss server but now i want to host it on my local machine. i got the backup of database from server in form of .mdf file. now how can i add this in my existing application and use this as data source instead of the one located on vss server.
I copied it into the root directory of web site and changed the connectin string accordingly in web.config but its not working. i am facing following error:
"CREATE DATABASE permission denied in database 'master'."
Kindly guide me how can i solve this problem. Thanks in advance..
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
|
Hi,
I would like to know how to do Versioning for Webservices..I have read some articles saying we can create versioning by giving different endpoints for the webservices or by changing the URL.Can anyone help me in understanding this clearly.Your answers are valuable to me..
Thanks - Kalai.
|
|
|
|
|
|
Thanks for your reply and for the link too..
|
|
|
|
|
hi
I want to check the sessionID in my every page's page load event. Is there any proper way to chech it,it's urgent please replay soon
thanks in adv.
regards
bikash
|
|
|
|
|
|
I have converted my application from asp.net1.1 to 2.0 after successfull build when running its giving following error---
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "OptimaTest.NZResource.resx.resources" was correctly embedded or linked into assembly "App_GlobalResources.3wq22sqr" at compile time, or that all the satellite assemblies required are loadable and fully signed.
m using resource in following manner
RM = New ResourceManager("OptimaTest.NZResource.resx", System.Reflection.Assembly.Load("App_GlobalResources"), Nothing)
lblMainTitle.InnerText = RM.GetString("lblMainTitle")
and the error is on the second line.
could any one please suggest me any solution.
waiting
With Thanks & Regards
Amit Sk Sharma
|
|
|
|
|
Hi Guys,
I need to create an Application in C#/ASP.NET which can create an Website in SharePoint 2007.
Please send me information regarding this.
thank you
Mohamed Nazeem
Software Engineer
Bangalore
|
|
|
|
|
You can create webpart or cheat.
webpart: See MSDN docs on webparts
cheat: create a standard asp.net web site then use Sharepoint website pageviewer to embed the website inside sharepoint.
Cheating is much easier quicker.
|
|
|
|