|
indian143 wrote: I want to convert in to byte array
GetBytes(yourString);
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
And where are the implementation of GetBytes??
|
|
|
|
|
System.Text.Encoding.GetBytes()
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
|
|
|
|
|
System.Text.ASCIIEncoding encoding=new System.Text.ASCIIEncoding();
Byte[] bytes = encoding.GetBytes(yourString);
- Happy Coding -
Vishal Vashishta
|
|
|
|
|
Please guy I need a source code for ayo (the african board game) for my project
|
|
|
|
|
|
How we can show overlapping form in asp.net
|
|
|
|
|
|
I am using resx for localisation the language.My reqt is when i change the data in grid view then it also update the resx file as i am populating the grid from resx file only, not by database.
|
|
|
|
|
Sandeep Kumar Sinha wrote: when i change the data in grid view then it also update the resx file
Not clear!
RESX files are static files where you define all the strings that needs to be localized. Once done, you refer those localized string from RESX file everywhere in your application.
There is no connection of updating datagrid internally updating RESX file.
|
|
|
|
|
Hi i am using Clearcase and created a view for my project.
the project is developed in framework 4.0, crystal report 2010 & vs 2010.
When i execute the report which i have created a view, its working fine.
In the same system i have taken the project one more copy and when i excute the report its shows this error
"The base class includes the field 'CrystalReportViewer1', but its type (CrystalDecisions.Web.CrystalReportViewer) is not compatible with the type of control (CrystalDecisions.Web.CrystalReportViewer)."
What should i do, please guide me
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Member 3879881 wrote: The base class includes the field 'CrystalReportViewer1', but its type (CrystalDecisions.Web.CrystalReportViewer) is not compatible with the type of control (CrystalDecisions.Web.CrystalReportViewer)."
Looks like you have mismatched Crystal versions or wrong reference in case of multiple version.
Have a look at this similar thread discussion that is marked resolved: Parser Error Message: The base...[^]
Also, Parser Error – Not compatible...[^]
|
|
|
|
|
Is this possible to create your own design of an event calendar using a Visual Basic.net for web development?
I'm just a trainee and yet starter...
I will highly appreciate your comments.. thanks for reading this.
hermaine...",)
|
|
|
|
|
Of course you can. .NET is largely language agnostic, which is just a fancy way of saying if you can do it in one .NET language, you can do it in another.
|
|
|
|
|
thanks sir..
hermaine...",)
|
|
|
|
|
yes..its true...+5 for it
Happy Coding...
|
|
|
|
|
I have a web application to display sales data. My input, transaction_header table, is like this:
... | van_id | sale_date | ... | ... | Van A | 2012-03-01 17:28:38.000 | ... | ... | Van A | 2012-03-01 17:33:54.000 | ... | ... | Van B | 2012-03-01 12:33:48.000 | ... | ... | Van B | 2012-03-01 12:38:14.000 | ... |
I need to export the transaction data to excel and the excel would show as:
Gross Sales | DATE | Van A | Van B | Van C | ... | 1-Mar | $3,359 | | | ... | | $49,934 | $20,657 | $41,481 | ... | 2-Mar | $3,633 | | $4,263 | ... | | $73,394 | $38,134 | $41,083 | ... | 3-Mar | | | $2,118 | ... | | $40,831 | $39,838 | $32,344 | ... | 4-Mar | SUNDAY | 5-Mar | $4,387 | | $3,842 | ... | | $84,814 | $39,242 | $41,116 | ... | ... |
My problem is the number of van may change over time. For the transaction_header table, this does not post a problem as there is just one more row. Yet for the output, it is a problem. Thw columns of my table may increase over time. Now how do I approach this problem?
Appreciate any feedback. Thanks.
modified 19-Apr-12 22:57pm.
|
|
|
|
|
hmmm..... you can do it.... good luck!
|
|
|
|
|
There are a ton of examples online of how to export data to Excel. Start here.[^]
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Yes, there are tons of example out there. My question, I think, is more specific. The number of columns may increase (or even decrease, although I doubt it will) over time. Now how can I handle this?
|
|
|
|
|
Quote: The number of columns may increase (or even decrease, although I doubt it will)
That is just fine. Most examples I have seen use a DataGrid and set AutoGenerateColumns = true. This means that it does not matter how many columns you have.
The code is have used before is here.[^] All you have to do is set the datasource of the datagrid.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Try This...it will work as per your requirement:
protected void cmdExport_Click(object sender, EventArgs e)
{
clsDataAcess oDataAccess = new clsDataAccess();
oDT = new DataTable();
oConst = new clsConstMaster();
string filename = string.Empty;
try
{
oDT = oDataAccess.GetCustomerWholeInformation(Parameter To function Here);
if (oDT.Rows.Count > 0)
{
filename = "CustomerInformationFromMaster.xls";
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
DataGrid dg = new DataGrid();
dg.DataSource = oDT;
dg.DataBind();
dg.HeaderStyle.BackColor = System.Drawing.Color.LightGray;
dg.HeaderStyle.Font.Bold = true;
foreach (DataGridItem i in dg.Items)
{
foreach (TableCell tc in i.Cells)
{
tc.Attributes.Add("class", "text");
//tc.BackColor = System.Drawing.Color.Blue;
}
}
dg.RenderControl(hw);
string style = @" .text { mso-number-format:\@; } ";
Response.Write(style);
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
this.EnableViewState = false;
Response.Write(tw.ToString());
Response.End();
}
}
catch (Exception ex)
{
MessageBox(ex.Message.ToString());
}
}
public override void VerifyRenderingInServerForm(Control control)
{
}
- Happy Coding -
Vishal Vashishta
|
|
|
|
|
Hi,
I have a repeater control, for which I have header template and item template. Both are in different divs. Both divs are creating rows and border properly. The problem now is the header is having gap and then its body.
Is there any way that we can have border for the whole repeater control? Any sort of link or code snippet would be greatly helpfull.
thanks in advance,
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
|
Is it a vertical gap or horizontal gap?
|
|
|
|