|
Hi, add another \ to every \ you have in the connectionstring.
Hope this one can help
Thanks
|
|
|
|
|
i have tried it before, it dosent do any change, becuse i added @ before the connection string.
Gindi Bar Yahav - Web & Software defeloper.
|
|
|
|
|
Hi
Say I have 3 classes Book, Page and Chapter. A Book has many Pages, a Page has many chapters.
I wrote it so that Page has a reference back to Book and Chapter has a reference back to Page which I found really useful because I could pass around Page but still get access to the Book object and find out how many other pages there are (as an example).
Of course, this creates a circular dependency which, now that I need to, I can't serialise this with XML.
What should I have done ? Have another object that maintained references to all these objects ? Passed both Book, Page & Chapter around rather than just Chapter ?
If anyone can shed a little light I would be very pleased.
Thanks
|
|
|
|
|
For serialization, you could decorate the back references properties or public members with the [XmlIgnore] attribute, but that would not solve the deserialization problem.
I suggest you review your design. Could you post the code for your classes, I may be able to give you some pointers.
|
|
|
|
|
Hi, Thanks for replying.
I tried the XmlIgnore route but then realised that there is no AfterSerialisation on XML Serialisation which mean that it wasn't what I wanted.
With classes like this
<br />
public class Book<br />
{<br />
public List<page> Pages { get; set; }<br />
public string Title { get; set; }<br />
}<br />
public class Page<br />
{<br />
public Book ParentBook {get;set}<br />
public List<chapter> Chapters { get; set; }<br />
public int PageNo { get; set; }<br />
public Page(Book parent)<br />
{<br />
ParentBook = parent;<br />
}<br />
}<br />
public class Chapter<br />
{<br />
public Page ParentPage { get; set; }<br />
public string Heading { get; set; }<br />
public string Content { get; set; }<br />
public Chapter (Page parent)<br />
{<br />
ParentPage = parent;<br />
}<br />
}<br />
</chapter></page>
I can do something like this
<br />
Book b = new Book() { Title = "My Book" };<br />
Page p = new Page(b) { PageNo = 1 };<br />
Chapter c = new Chapter(p) { Heading = "Introduction" };<br />
<br />
RenderChapterNavigation(c);<br />
<br />
private static void RenderChapterNavigation(Chapter c)<br />
{<br />
if (c.ParentPage.Chapters.Count == 0)<br />
{<br />
RenderNoChaptersLink();<br />
}else{<br />
RenderChapters(c);<br />
}<br />
}<br />
(this is not the exact code, but you can see how I can references the other chapters after having just passed in a Chapter object).
|
|
|
|
|
What kind of XML structure are you expecting?
|
|
|
|
|
Hi
I have no preference on the structure but what I wanted was to to have the backward-links from Page to Section and Page to Book reestablished automatically when I deserialised it.
Thanks for your replies
|
|
|
|
|
I have a number of test that each submit an object to a Queue (that is declared statically in my Unit test Class) The queue automatically processes each item until there is non left and then fires an event allProcessed.
The problem, is that for each unit test all i test is that it was added to the queue correctally, and i need to let the queue finish processing and at the moment it is getting cut off becasue all the tests finish before the queue processed.
Is there any way to make the test run wait until the allProcessed is fired?
Thanks
|
|
|
|
|
Just checked in
public static void MyClassCleanup()
{
if(QueueLength!=0)
{
Thread.Sleep(1000);
}
}
|
|
|
|
|
Hi,
I've developed an application that uses a few font styles that might not be present in all machines... How can I embed these fonts when I deploy my application at the Client's system, assuming that his system does not have those fonts installed... Please suggest...
Thanks in Advance,
ramz_g
|
|
|
|
|
|
Hi Eddy,
Thanks for the reply... But I think you misunderstood my question... Suppose my client's system does not have a font style named "xyz" which I used in my application. I asked how to embed the font in my application and deploy the application on my client's system so that he sees the same font styles that I used while developing the application.
|
|
|
|
|
|
Hi,
have a look at the PrivateFontCollection Class.
|
|
|
|
|
You do need to be careful here, as if they don't have the fonts installed, they might not then have licenses to use them. You don't want to be distributing copyright material now...
|
|
|
|
|
Hi All,
Thanks a lot for the suggestions...
Thanks,
ramz_g
|
|
|
|
|
Hello,
i had build a selfdefinied form in Outlook. This is named by "IPM.Note.Pizza" and is located in the Mailbox. Now I want open outlook with C# (Microsoft.Office.Interop.Outlook) and set the value of the Combobox (CB_Pizza). I know how its look like by a normal mail, but how is the way by selfdefined forms?
Thank you
Christoph Herzinger
|
|
|
|
|
|
well I think you are going to have to pay someone to do it as you don't seem to have the ability to try/do for yourself
Why is it so urgent? Are you getting paid to do this?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Search the articles on this site for Gantt Chart and you will find enough to get you well on your way.
And please avoid using the word "urgent" in any future messages.
|
|
|
|
|
Sounds like you took a rentacoder job and then realised you have no idea how to do it. Contact the client, tell them you are a liar.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi all,
Ok this is the problem. I am using the microsoft MVC web framework to build a web app. I have a method that uploads files to the server by retriving the HttpPostedFileBase files from the HttpFileCollectionBase in the Request. I then invoke the HttpPostedFileBase method SaveAs(path) to save those files to the filesystem.
I have just implemented a Remove method that takes the filename and path, ensures the existence of the file by calling File.Exists() then attempting to call File.Delete() to remove the said file. The problem is when I have just uploaded this file, when I go then to delete it right away I get a
"The process cannot access the file 'C:\....\file.jpg' because it is being used by another process."
Now I suspect that that HttpPostedFileBase method SaveAs() has locked that file and not released it. But I am not 100% sure. My only other suspision is that the actual page view method goes and does a:
DirectoryInfo info = new DirectoryInfo(imagesPath.ToString());
FileInfo[] files = info.GetFiles();
In order to retrieve all the files located in that directory. One of the two of these is locking that file. I am more inclined to believe its the SaveAs() method as the remove works intermittently and if it were the page view I'd expect it not to work ever.
Does anyone know anything about this, I have been googling away like mad trying to find out how to get HttpPostedFileBase to release the file its just saved with no avail.
Cheers.
|
|
|
|
|
Hi daviiie;
I have exactly the same issue and tried this, thinking SaveAs locking the files as you did but id didn't work, so something else is locking the files:
using (FileStream fs = new FileStream(fileName_save, FileMode.Create))
{
byte[] bytes = new byte[Request.Files[i].InputStream.Length];
Request.Files[i].InputStream.Read(bytes, 0, (int)Request.Files[i].InputStream.Length);
fs.Write(bytes, 0, bytes.Length);
fs.Close();
}
Did you have any progress for the issue?
Thanks.
|
|
|
|
|
Hi,
Please let me know how to open a file from .net application.
Thanks in advance.
|
|
|
|
|
StreamReader sr = new StreamReader(fileName);
StreamWriter sw = new StreamWriter(fileName);
|
|
|
|