|
Search for normalization, that will help you.
Alternatively you could choose a delimeter like a pipe ("|") and seperate the codes with the delimeter in the one field. (eg: code1|code7|code23) However, I would NOT recommend this, but it could be you encounter this device sooner or later. A bridge table is the way to go.
V.
|
|
|
|
|
Look into Master/Detail forms, Matt. You can create a table for RepairEvents as a lookup source, perhaps, and then add a table that describes multiple repair codes for a single event with the RepairEvent ID as a foreign key. It's not really a major change, which should make your manager happy. Keep in mind, though, that if you have a busy database, you're going to quickly run into problems using Access. If you have more than about 5 people who need to use your database, or the .mdb file grows to about 1 GB in size, it's going to blow up on you. You really should start thinking about migrating to SQL Server; the Express version is free, handles multiple users better, and extends your limit to about 10 GB.
I'm working on several such applications in my "free" time, to manage electrical substation inspections, sewer lift station repairs, and water system events, so I know what you're going through. It would be very convenient if each event resulted in just one repair, but that rarely occurs in the real world. Best of luck to you! And when you have it resolved, publish your solution as an article and show the rest of us how you solved the problem.
Will Rogers never met me.
|
|
|
|
|
How we can concatenate the word document, I explain, i would make a single document of 1000 pages (each document is on one page) and then save only a single document instead of 1000, thank you much.
i use this to crate one document :
String[] tbStr2 = s.Split(new Char[] { ';' });
string nb = tbStr2[0];
Object oMissing = System.Reflection.Missing.Value;
Object oTrue = true;
Object oFalse = false;
Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document();
oWord.Visible = true;
oWord.Visible = false;
Object oTemplatePath = modelee;
oWordDoc = oWord.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);
bool sympb = false; bool E = false; bool n = false; bool p = false; bool r = false;
foreach (Microsoft.Office.Interop.Word.Range range in oWordDoc.Words)
{if (range.Text.Trim().Contains("$"))
{ int pos = range.Text.Trim().IndexOf("$");
string str = range.Text.Trim().Replace("$", "");
range.Text = str;} }
foreach (Microsoft.Office.Interop.Word.Range range in oWordDoc.Words)
{if (range.Text.Trim().Contains("$$"))
{ int pos = range.Text.Trim().IndexOf("$$");
string str = range.Text.Trim().Replace("$$", "");
range.Text = str;} }
Object oSaveAsFile ="./1.doc";
oWordDoc.SaveAs(ref oSaveAsFile, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
oWordDoc.Close(ref oFalse, ref oMissing, ref oMissing);
oWord.Quit(ref oMissing, ref oMissing, ref oMissing);
|
|
|
|
|
Yes, should be possible. What are you using to "read" the document?
Bastard Programmer from Hell
|
|
|
|
|
A tip you will often see is to record a macro for the operation you want to perform. In your case just find out what code is generated for the Insert File operation.
In Word 2002 the macro code is
Sub Macro1()
Selection.InsertFile FileName:="xxxxx.doc", Range:="", ConfirmConversions:= False, Link:=False, Attachment:=False
End Sub
From the MS Word Visual Basic reference we can get the InsertFile method signature and remove the named arguments to give the conventional method call
Selection.InsertFile("xxxx.doc", "", False, False, False)
which can be easily translated into C#.
Alan.
|
|
|
|
|
Who in their right mind would want to open a 1,000 page document in Word?? That'll take, what, a few hours to do?
|
|
|
|
|
No, only a few seconds if not bloated with a shed load of pictures. E.g. the C# Specification v3.0 is 519 pages and takes about 3 seconds to open over here in the UK.
Alan.
|
|
|
|
|
Damn, must be my machine.
|
|
|
|
|
|
Thank you verry mutch for your answer, so i need to merge the word file in the memory, because i don't want to generate all 1000 files. please help me.
|
|
|
|
|
Hi,
I have a problem in deserializing the xml which is coming from Java side in soap form.
Here is my code..
var responseText = res.XmlDocument.GetElementsByTagName("soap:Body").Item(0).InnerXml;
var memoryStream = new MemoryStream(Encoding.Default.GetBytes(responseText));
var ClsEmpResponse = (Request.ClsEmp.EmpResponse)xmlSerializer.Deserialize(memoryStream);
_oLog.LogStackTrace("*************DAE VIEW REQUEST*************");
_oLog.LogStackTrace(responseText.ToString());
return ClsEmpResponse;
here in this code, am getting the response as it is saved in database(for ex, it contain Nested Condition:3) in responseText.
but after i pass it to the memory stream, it is showing that it contain only 1 condition in the loop in ClsEmpResponse.
ClsEmp is the class contain in Request folder in my application, which is having some fields, where i read and write the data into/from that field.
so can u tell me what is d problem here..
Why it is not taking the exact value which is coming in responseText.
why its not reading the same xml format which is in
|
|
|
|
|
I suspect that it is because you haven't told it what the soap: prefix means.
Here's what I had to do to use the xi: prefix:
System.Xml.XmlNamespaceManager nsm =
new System.Xml.XmlNamespaceManager ( Document.NameTable ) ;
nsm.AddNamespace ( "xi" , "http://www.w3.org/2001/XInclude" ) ;
System.Xml.XmlNode nod ;
while ( ( nod = Document.SelectSingleNode ( "//xi:include" , nsm ) ) != null )
Try something like that.
|
|
|
|
|
Hi,
I would like to know how to make multiple asynchronous web service method calls in the same thread? What if the web service method cannot be checked by IAsyncResult status operation statement but just invoking the MethodNameAsync(X,Y,Z).
What I think is sleeping the thread shouldn't be the way to handle it because lets assume that 20 of form controls inside the form uses web methods to populate themselves and one of the control's value is used as an argument to call another asynchronous method to populate another control in the form .
The problem is I have a few asynchronous call in the same thread and I couldn't figure it out how to create waits between the each asynchronous calls until it gets loaded completely. Is there a way to load all asynchronous methods before the form loads.
if you enlighten me about the solution, I would really appreciate it. This is my first Web Service client issue to solve and I have no experience about it.
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
modified on Tuesday, May 24, 2011 9:28 AM
|
|
|
|
|
JUNEYT wrote: Is there a way to load all asynchronous methods before the form loads.
If the calls are truly asynchronous then there should be some notification of completion (like an event).
I use something similar to the DomainContextLoadBatch class found in this article[^]. This class lets you queue up a bunch of asynchronous calls and doesn't notify you until they have all completed. The class as shown is for WCF RIA Services LoadOperation calls, but could easily be modified for other webservice call types.
*edit* If you use that class as a guide, please note that as shown the class is NOT thread safe, so if your webservice calls can complete on other threads you'll need to make sure at least the class' single completion handler is thread safe.
You shouldn't have to sleep and wait...that negates the whole purpose of asynchronous calls...
Mark Salsbery
Microsoft MVP - Visual C++
modified on Tuesday, May 24, 2011 12:03 PM
|
|
|
|
|
List<MyStyle> styles = new List<MyStyle>();
foreach (var item in items)
{
styles.Add(GetMyStyle(item.style));
}
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
|
|
|
|
|
I don't think LINQ is meant to do this.
LINQ is "Language Integrated Query", a query being something of a question used to select, modify or delete data.
The performance gain, if any, will be slight.
I actually think it might slow it down.
But if you must...
(Doing this from memory)
List<MyStyle> styles = new List<MyStyle>();
styles.AddRange((MyStyle[])(from item in items select GetMyStyle(item.style)).ToArray());
|
|
|
|
|
may be you are right. i was just wondering how to do that using LINQ.
anyway thanks for the reply.
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
|
|
|
|
|
Off the top of my head:
List<MyStyle> styles = items.Select(item => GetMyStyle(item.style)).ToList();
|
|
|
|
|
|
It's LINQ using a Lambda expression, as a lot of LINQ does.
|
|
|
|
|
thanks..
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
|
|
|
|
|
No problem. Glad to help.
|
|
|
|
|
I think you may use its constructor to add values in it.
List<MyStyle> l = new List<MyStyle>(items.Select(s => GetMyStyle(s.style)));
Thanks
|
|
|
|
|
try like this ,
var styles=items.Select(item=>GetMyStyle(item.Style)).ToList();
sorry...answers are already there
modified on Wednesday, May 25, 2011 9:29 AM
|
|
|
|
|
Hi all,
I need some advice here, I hope somebody can help me.
I have the following class structure (simplified):
public class Bar: IDisposable {...}
public abstract class FooBase: IDisposable
{
Bar bar;
bool disposed;
internal FooBase(Bar bar)
{
this.bar=bar;
}
public void Dispose()
{
if (!this.disposed)
{
this.bar.Dispose(true);
GC.SupressFinalize(this);
this.disposed = true;
}
}
protected void Dipose(bool disposing)
{
if (disposing)
{
this.bar.Dispose();
}
}
}
public FooA: Foo {...}
public FooB: Foo {...}
public static class FooProvider
{
public static FooA GetFooA()
{
Bar bar = new Bar();
...
return new FooA(bar);
}
public static FooB GetFooB()
{
Bar bar = new Bar();
...
return new FooB(bar);
}
...
}
When I run Code Analysis on this, I get Warnings CA2000 on all 'CreateFooX()' methods of the FooProvider class. This warning gives the following message: "Microsoft. Reliability: In method 'FooProvider.GetFooX()', call System.IDisposable.Dispose on object 'bar' before all references to it are out of scope."
Microsoft recommends to never supress this warning but I'm not really sure its warning about a real problem in the code. True that 'bar' is not disposed before going out of scope in whatever 'CreateFooX()' method we consider but a reference to it lives on in the 'FooX' object which eventually will get disposed and will in turn take care of disposing 'bar'.
Am I understanding something wrong about how the Dispose pattern should work and I have some fundamental flaw in my code or should I just supress this warning?
Thanks for any advice.
|
|
|
|
|