|
Why not use Tab separated values or some other simplified format? DataTable is a very heavy object and serializing it would give you significantly more bytes to transfer. And from my experience Excel is pretty dumb when it comes to things like data types, so all of that info from the database would probably be lost in translation anyway.
|
|
|
|
|
That's another approach I've suggested to our developer, but entails more work. Besides, this is local intranet app, so bandwidth isn't a problem.
This is not transfering to/from Excel however, it's a WPF app.
dev
|
|
|
|
|
Hi All,
I'm getting some requests to port an application I've built using WPF/C#/SQL Compact to the Mac platform.
My understanding of the general tasks to achieve this are:
Re-write the whole UI (No WPF Support in Mono)
Replace all database access to use MySQL or other DB
The rest of the C# code is targeting C#3.0/.NET 3.5 SP1 so I'm guessing that an absolute stack of this will need re-writing as well as Mono is more or less .NET 2.0 compatible. I'm just trying to get a feel for the total effort that would be required to do this. I keep coming to the conclusion that it would be more or less a complete re-write from the ground up which is kinda daunting at the moment.
Anyone performed a similar task that can give me a bit more insight?
Cheers,
|
|
|
|
|
Jammer wrote: as Mono is more or less .NET 2.0 compatible
Mono is completely compatible with 2.0, and 3.5 is largely supported to. A better comparison with Microsofts' .NET can be found here[^].
Most popular topics on Mono can be found here[^].
I are Troll
|
|
|
|
|
WPF can't be ported to Mono because it relies on MS DirectX for rendering .Silverlight could be partially ported to Mono using Moonlight platform.
Life is a stage and we are all actors!
|
|
|
|
|
Hello
SilverLight 4 is a good choice for you. The Out Of Browser -aka OOB- has major improvements. I did an application for Mac this way in SilverLight 3 but the experience were't rich. Two major improvements that could have saved me a lot of trouble are the elevated permissions and the printing support.
Also porting your WPF to Silverlight is a bit easy as both rely on Xaml and Silverlight is just a subset of WPF. As for the database; the typical solution is to put your database on a windows server and communicate using services. If your program is a stand alone and this is not an option you can use some of the embedded DB engine. I don't remember any now but I remember I saw a few names to use back when I made my app.
If you use LINQ and your data access isn't huge or demanding your can switch your (LINQ to SQL) to (LINQ to Xml) and store your data as an Xml file.
P.S.
Make good analysis on the OOB in SilverLight 4. There could be some features in your program not covered.
Regards
|
|
|
|
|
If your program is a stand alone and this is not an option you can use some of the embedded DB engine. I don't remember any now but I remember I saw a few names to use back when I made my app.
OS X comes with SQLite "built in", perhaps this is a possibility...
|
|
|
|
|
The mono project has a tool named Moma which is designed to help you figure out
what is missing from mono for a particular project you want to port.
Run the tool on your current implementation and you should be able to find out
what is missing from mono.
Moonlight has full support for Silverlight 2.0.
Hope this helps.
---
Adar Wesley
|
|
|
|
|
Haven't done it, but the Mono site has an analysis tool that will help you figure out how much effort is needed. It basically checks the compatibility of the BCL calls with what is available in Mono.
|
|
|
|
|
You can consider using the following technologies on Mac:
1) Silverlight 4 as a replacement for WPF (the most closest approximation though not 100% complete)
2) SQLite as a replacement for SQL CE (Mono has good support for SQLite)
3) In this case, you will need to re-design your app to support multiple layers (DAL/BLL exposed via WCF - it is partially supported by Mono, specifically for Mac), UI layer running on Silverlight.
This is what I would do if I were in your shoes.
|
|
|
|
|
Is it an option to use a VM?
You could run the app in a VM hosting Windows in 'integrated' mode (or whatever its called) and the app will appear to be running 'like a native app' (i.e. without being inside the VM's virtual desktop). I think VMWare has a Mac version; Parallels is the other major VM for the Mac.
If its politically acceptable to the client to do this, it might be much cheaper (VM license + Windows license + small amount of work) to go this route than the porting route. Of course, there are maintenace burdens once you have a VM that hosts something of importance...
|
|
|
|
|
i have column called receipt_no, student_id, paid_amt, Bal_amt
he paid for 4 installment, after 4th he paid fully. in database 4 rows is there. but thata student now paid. i should not select that student and the student who paid less than total i am able to select that student details. but if 3 rows or 4 rows means i am not able to select. How it can be selected. Any suggestion please reply.
i written code like below
select * from bed_fee where Bal_amt >0 and paid < 30000
but here it will select upto 3 rows but he paid like below
receipt_no stud_id paid bal total
243 815 10000 20000 30000
244 815 15000 50000 30000
245 815 3000 2000 30000
246 815 2000 0 30000
if 4 th rows is not there means i need to select that student. if 4th row is there means bal is 0 i should not select
how can i write select query here
|
|
|
|
|
First this is not SQL forum
However you can do one thing first find the students who does not paid total balance amount and select only those students. may be like
SELECT A.* FROM bed_fee AS A
WHERE EXISTS (
SELECT stud_id FROM bed_fee WHERE A.stud_id = bed_fee.stud_id
GROUP BY stud_id
HAVING SUM(total ) <> SUM(paid)
)
|
|
|
|
|
thank you for replying. Now it is working.
|
|
|
|
|
Hi,
your data is redundant so there must be several solutions; try one of these(untested):
SELECT stud_id WHERE sum(paid)<total GROUP BY stud_id ORDER BY stud_id
SELECT DISTINCT stud_id WHERE stud_id NOT IN (SELECT stud_id WHERE bal=0)
|
|
|
|
|
sr159 wrote: i have column called receipt_no, student_id, paid_amt, Bal_amt
First go back and correct your schema.
|
|
|
|
|
Hi,
Is it necessary to have .Net Framewrok installed to you power shell?
regards,
NetQuestions
|
|
|
|
|
Yes, for further information see this page[^].
It's time for a new signature.
|
|
|
|
|
hi,
I thought in the namespace System.Management, I would find classes / methods or rather some interface
that I can use to get some management information, say about IIS.
But System.Management only has attributes like 'ManagementConfigurationAttribute' which states that
the property is read-only.
So how do I get the interface to access information about IIS in a console application.
Regards,
NetQuestions
|
|
|
|
|
What kind of information are you speaking about? You can use WMI for information about IIS. See if this[^] helps.
|
|
|
|
|
Hi,
I have gridview.
I need to export the data to excel and zip it
I had used dot net zip free dll
The zip file is not having the excel.
Need help how to include the excel file in zip
the below code creates zip file
using Ionic.Zip;
using System.Text;
using System.IO;
using Ionic.Zlib;
protected void btn_Export_Click(object sender, EventArgs e)
{
HtmlForm form = new HtmlForm();
string attachment = "attachment; filename=Employee.xls";
Response.ClearContent();
Response.ContentType = "application/ms-excel";
System.IO.StringWriter stw = new System.IO.StringWriter();
HtmlTextWriter htextw = new HtmlTextWriter(stw);
form.Controls.Add(grd);
this.Controls.Add(form);
form.RenderControl(htextw);
var filesToInclude = new System.Collections.Generic.List<String>();
if (filesToInclude.Count == 0)
{
Response.Clear();
Response.BufferOutput = false;
System.Web.HttpContext c = System.Web.HttpContext.Current;
//string archiveName = String.Format("Employee.zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss"));
string archiveName = String.Format("archive-{0}.zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss"));
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "filename=" + archiveName);
// ZipFile zip = new ZipFile();
using (ZipFile zip = new ZipFile())
{
//zip.AddFile("export.xls", "content");
zip.Encryption = EncryptionAlgorithm.WinZipAes256;
// filesToInclude is a string[] or List<String>
zip.AddFiles(filesToInclude, "files");
zip.Save(Response.OutputStream);
// zip.Save(archiveName);
}
Response.Close();
}
}
Thanks
S.Guhananth
|
|
|
|
|
Member 3222264 wrote: //zip.AddFile("export.xls", "content");
..why is that line commented out?
I are Troll
|
|
|
|
|
tried
zip.Addfile("export.xls","content");
getting this error
C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Employee.xls
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Employee.xls
|
|
|
|
|
Member 3222264 wrote: tried
That was the part that seemed to be used to add files to the zip-archive. An empty list of files will result in an empty archive.
Member 3222264 wrote: getting this error
Check if the file below exists;
C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Employee.xls
If the file doesn't exist, then it won't be added to the archive. Make sure you call the code that creates the Excell-file before adding it to the list.
I are Troll
|
|
|
|
|
while exporting to excel how the file will be in this path
the below works fine to export it as excel
HtmlForm form = new HtmlForm();
string attachment = "attachment; filename=Employee.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
System.IO.StringWriter stw = new System.IO.StringWriter();
HtmlTextWriter htextw = new HtmlTextWriter(stw);
form.Controls.Add(grd);
this.Controls.Add(form);
form.RenderControl(htextw);
Response.Write(stw.ToString());
Response.End();
but i do not know why the Employee.xls is not attached to excel
Do u have sample code to zip the file and export?
|
|
|
|