|
Is this only for certain kinds of serialization because I just in the past few minutes successfully manually persisted the objects using the following code. It works perfectly except that it uses a file that the user can screw with which I wanted to avoid. I.E. They could move the program without the file.
for loading
if (File.Exists(settingsFileName))
{
Stream TestFileStream = File.OpenRead(settingsFileName);
BinaryFormatter deserializer = new BinaryFormatter();
accounts = (Accounts)deserializer.Deserialize(TestFileStream);
TestFileStream.Close();
foreach (Account a in accounts.List)
{
ListViewItem item = new ListViewItem(new string[] { a.Broker, a.Name, a.AccountNumber, a.Balance.ToString(), a.Equity.ToString() });
listView1.Items.Add(item);
}
}
for saving
Stream TestFileStream = File.Create(settingsFileName);
BinaryFormatter serializer = new BinaryFormatter();
serializer.Serialize(TestFileStream, accounts);
TestFileStream.Close();
|
|
|
|
|
Yes, binary serialisation works differently and does not have the constructor/public property constraints of xml. There is information on MSDN but it's quite heavy going and the implications of what they're saying may not become apparent until you've made a few mistakes of your own.
Serialization[^]
Good luck, Alan.
|
|
|
|
|
ok so after getting frustrated I decided to run a test. My thinking was that maybe it can't save it. It would seem this is correct but I don't know why. I tried to save a string using the same method and it worked without editing the app.config file. So then I would try just to save one instance of the nested class Account and it did not work either so who knows.
|
|
|
|
|
hi to all
i have a very complex problem in crystal report can every one help me for this problem?
thanks for any idea
my problem:
i have a report when my store procedure return 30 row ,this rows
show in two page ,row 28 will be disappeared and remove from the report.
i re size my report header and footer ,but my problem is already exist
|
|
|
|
|
Post it in a different forum with report sections screen shot to get the answer. People will look for C# questions here.
modified 11-Apr-13 6:00am.
|
|
|
|
|
|
Hi I been searching for a source code of flow free puzzle game, does anybody tell where can find it?
in c#
|
|
|
|
|
I found lots of them here[^]
|
|
|
|
|
I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields..
question is, given a file path,how do i automate the process of attaching a file to that email and sending it?
Scoured the web without finding a solution,
So help will be greatly appreciated
annex
|
|
|
|
|
What do you mean by "pops"??
How are you accomplishing what you already have?? If it's launching a "mailto:" link, attachments are not supported.
|
|
|
|
|
You need to read the SMTP spec for multipart messages and MIME encoding.
|
|
|
|
|
If I were you I'd use the .NET API to achieve your goal.
See here: MailMessage Class[^]. It even sports an example with an Attachment[^].
Regards,
— Manfred
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
You don't mention if but if you are working with Outlook as the local mail agent, there are a number of pain is the butt things you have to look out for... including the security authorization pop-up when you try to send mail via Outlook from another application and the restrictions around attachment types and the automatic stripping that can occur.
If you have to deal with Outlook, there is a library called the "Outlook Redemption" library which makes it a breeze. I've used it before and it is by far the best way to deal with Outlook as the local mail agent. Especially if you have to send via Exchange because you don't have to setup a risky SMTP relay on the exchange server. The website is here: http://www.dimastr.com/redemption/home.htm[^] And best of all, you can send e-mail as the current user without their intervention... no need to 'pop' the message if you don't want to.
|
|
|
|
|
i want record guitar sound from microhone
and in my program detect note of it
is it possible ?
|
|
|
|
|
|
Thanks for the link to an interesting article. 5+
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Manfred R. Bihy wrote: Thanks
You're welcome!
|
|
|
|
|
in my example it's show that I put only one marker but lets say I add much more markers and I only want to remove marker in my array in index 0.
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox1.Checked == true)
{
GMap1.addGMarker(markers1[0]);
}
else
{
}
}
|
|
|
|
|
..and who told you what to write in the first "if"?
The "addGMarker" method returns an object, and according to the documentation one could call the "remove" method on that object. Says here on the page it's deprecated. What version of GMaps are you using?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
how can i print data from dataGridView using rdlc report
|
|
|
|
|
abdallah ramdan salem abdo wrote: print data from dataGridView using rdlc report
That does not make sense. Datagridview is winforms and RDLC is SSRS thing.
If you want to show any tabular data in SSRS, you need to use it's tablix control where you define a datasource and query to fetch data to display.
|
|
|
|
|
first :- thanks vey much
secound :- whet i asking for is how to fill tablix by my dataGridView data
finaly thanks for your answer
|
|
|
|
|
abdallah ramdan salem abdo wrote: how to fill tablix by my dataGridView data
Tablix and datagridview both will be driven by same query that will get the needed data. Assume talix as datagriview - both needs a datasource for data - a query generally.
|
|
|
|
|
thanks for your attention
but i want copy data from dataGridView To Tablix without
any quary and without using dataBase
Thanks very much
|
|
|
|
|
first : thanks very much
secound : what i am asking for is how to fill tablix by data from dataGridView
finaly thank u vry mch
|
|
|
|