 |
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
|
 |
Eddy Vluggen wrote: Try MSDN;
those are no OOF Rules... I'm looking for the rules to set forwardings, not for OOF settings...
|
|
|
|
 |
Ah, my mistake.
Try MSDN[^] instead.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
 |
Hi,
that's not what I was looking for...
I'm looking for out of office rules, not inbox rules.
Difference is, that out of office rules are deactiveated autmaitcally once the user is back in the office...
|
|
|
|
 |
Frosch11111 wrote: that's not what I was looking for... If it is using Exchange, then it will be on MSDN.
Frosch11111 wrote: Difference is, that out of office rules are deactiveated autmaitcally once the user is back in the office Would that be implemented as something special in Exchange, or would it simple be a rule that gets deleted when the user is back?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
 |
Regarding Out-of-Office-Replies, let me tell a bad story.
Someday, a customer told us they could not receive emails from our company. They found out that the emails were blocked due to some spam filter rules. Somewhere in their spma-checking chain, they used a blacklist from spamhaus. And our company was listed there as a sender of spam.
How did we get there?
Some spammer sent an email to a colleague. Because she was on holiday, an Out-of-Office-Reply was sent to the "sender" of that email. But the "sender" was forged: it was a honey-pot address of spamhaus. Great!
Well, I do not know the further steps taken then to recover our status as a non-spammer - having analysed the situation to that point, I forwarded the issue to higher management. I do not know if they paid the money normally required by spamhaus or if they could convince spamhaus that the spam originated from some other place.
Anyway, since that time I suggest not to use spamhaus, and not to use Out-of-Office-replies either.
But who cares about that experience?
|
|
|
|
 |
I seem to be having problems when trying to run the shared sub from another class in my form1 application. The code works flawless when its called directly but when i try to multi thread the controls on form1 will not update.
The shared function and sub
Public Shared Function FileCount(PathName As String) As Long
Try
Dim FSO As New FileSystemObject
Dim fld As Folder
If FSO.FolderExists(PathName) Then
fld = FSO.GetFolder(PathName)
FileCount = fld.Files.Count
End If
Return FileCount
Catch ex As DirectoryNotFoundException
End Try
End Function
Public Shared Sub StartNewScan(ByVal FilePath As String)
Dim Allfile As String = "*.*"
Dim FFcount As Long
Dim MyFolderSize As Long
Dim FullPath As String
Using fse As New FindFiles.FileSystemEnumerator(FilePath, Allfile, True)
Dim ien As IEnumerator(Of FileInfo) = fse.Matches().GetEnumerator()
ien.Dispose()
For Each fi As FileInfo In fse.Matches()
FFcount += CStr(FileCount(fi.DirectoryName)).Length
Form1.Label3.Text = CStr( "File Count:" & FFcount)
MyFolderSize += fi.Length
FullPath = fi.FullName
Form1.Label4.Text = "File Path:" & FullPath
Next
End Using
End Sub
I am trying to call the shared sub in form1 like so
Dim StartSharedSub as new threading.thread(addressof Startnewscan)
startsharedsub.start()
I am aware of delegates and that it may be necessary in my case to use that to update my UI controls but I am confused how to implement it in my case.
thank you in advance
|
|
|
|
 |
You absolutely cannot touch UI controls from a thread.
You have to Invoke methods on the UI thread to update the controls for your threaded code.
There's a lot of examples[^] of this all over the web.
|
|
|
|
 |
Hi all - I'm looking for a motivated full stack developer to work independently within a team. The ideal candidate would be excited to learn and experiment with new technologies and with a passion for user-oriented design.
If you are interested, or know of someone who would be, please let me know. Thank you!
Required Skills:
• Microsoft .NET Framework ecosystem with C#
• ASP.NET MVC3 / MVC4
• Microsoft SQL Server 2008 / 2012
• Web Technologies: JavaScript, JQuery, AJAX
Desired Skills:
• Bachelor's Degree in Computer Science Preferred
• Web Development: HTML5, CSS3
• Knowledge of NoSQL
• Experience with Kendo UI
• Good communication skills
• Knowledge of IIS 7
• Web API/WCF
Victoria Feng
|
|
|
|
 |
This is not the place to post these.
|
|
|
|
 |
Ah, ok. Could you guide me to the right one please? Thanks!
Victoria F
|
|
|
|
 |
CP doesn't have a jobs board any more.
|
|
|
|
 |
Darn! OK, thanks for letting me know. Apologies for any inconvenience.
Victoria F
|
|
|
|
 |
Victoria Feng wrote: The ideal candidate would be excited to learn Try the nut-house.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
 |
Hi,
I have four related tables
AttoreTipo (1..n) Attore (1..n) CommessaAttore (n..1) Commessa.
AttoreTipo is a lookup table
i'm using entityframework 6 code first with repository and UnitOfWork patterns.
the model is:
public class Attore
{
public int Id { get; set; }
public int IdTipo { get; set; }
public string Nome { get; set; }
public string Cognome { get; set; }
public virtual ICollection<CommessaAttore> CommessaAttore { get; set; }
public virtual AttoreTipo AttoreTipo { get; set; }
}
public class AttoreTipo
{
public int Id { get; set; }
public string Tipo { get; set; }
public DateTime CreateDate { get; set; }
public DateTime? UpdateDate { get; set; }
public virtual ICollection<Attore> Attore { get; set; }
}
public class CommessaAttore
{
public int Id { get; set; }
public int IdCommessa { get; set; }
public int IdAttore { get; set; }
public DateTime CreateDate { get; set; }
public DateTime? UpdateDate { get; set; }
public virtual Commessa Commessa { get; set; }
public virtual Attore Attore { get; set; }
}
public class Commessa
{
public int Id { get; set; }
public string Descrizione { get; set; }
public DateTime EndDate { get; set; }
public DateTime CreateDate { get; set; }
public DateTime? UpdateDate { get; set; }
public virtual ICollection<CommessaAttore> CommessaAttore { get; set; }
}
In the aspx page, in the same button click event, i call the repository's method AddCommessaAttore(CommessaAttore commessaattore)
,where CommessaAttore has the attore property value by an Attore entity. Attore entity has an attoretipo prop. (attoretipo entity) not set because is a lookup table. Next i call getCommessaAttoriByCommessaId method, that read all commessaattore records by a given idcommessa, to fill a gridview,
but the AttoreTipo result always null. Entity framework don't resolve AttoreTipo entity
public CommessaAttore AddCommessaAttore(CommessaAttore commessaattore)
{
repository.Add(commessaattore);
SaveChanges();
return commessaattore;
}
public IEnumerable<CommessaAttore> GetCommessaAttoriByCommessaId(int idcommessa)
{
var activities = repository.GetMany(commatts => commatts.IdCommessa == idcommessa);
return activities;
}
thanks
|
|
|
|
 |
Did you define a relation between the two tables? If you open the database using Sql Management Studio, and generate a diagram of the tables, does it show a line between the lookup-table and the table in which it is used?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
 |
Yes tables are related. Anyway i solved using include and specifying tables attore.attore tipo. Thanks
|
|
|
|
 |
Sorry, sounded like something that simple might have been overlooked.. attore, an 'actor type'?
You're welcome
|
|
|
|
 |
Hi,
I need to make FolderBrowserDialog in asp.net and that should show all the drives present in the client system and i should get full folder path of the client system so that i can save the files in selected client folder.
How to achieve this.
If anybody knows, please reply me.
Thanks in advance.
|
|
|
|
|
 |
You can't without using an unsecure technology like ActiveX or Flash, or downloading an executable to the client side to run. It would represent a massive security hole if a website were able to get full access to the filesystem.
|
|
|
|
 |
In a .bat file, I need to find the 32-bit .NET Framework InstallPath on a 64-bit machine. Following is my code snippet:
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP" /s|FIND "InstallPath"|FIND "4.0."
However, it returns the InstallPath for 64bit:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
I actually need is something like:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\
Any suggestions are appreciated.
|
|
|
|
 |
Have you tried searching the Wow6432Node ?
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP" /s|FIND "InstallPath"|FIND "4.0."
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
 |
Wow! It works! Thank you very much! The name looks odd. What does the number mean? Will MS change it?
|
|
|
|
 |
As far as I'm aware, it refers to "Windows 32-bit on Windows 64-bit". The name hasn't changed since 64-bit support was added to Windows, and is unlikely to change in the future.
http://en.wikipedia.org/wiki/WoW64[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
 |
I have a table with a status column
The data is inserted with the status "treaty" and inserted again the status input,
I would make sure that the number of treated equals the number of input and forbid the insertion if the number exceeds the treaty.
Thank you in advance.
|
|
|
|
 |
Your question is not very clear, but it suggests that you should select all the records with each status and get the counts. Then compare the counts and insert or not as you need.
|
|
|
|
 |
Hi,
I need to send mail (not receive) from my application running on Windows Embedded Compact 7 (Compact Framework 3.5).
After a lot of googling and some test with EaSendMail, mailcf, cslmail... I found OpenNETCF that looks very promising but I'm not able to use it...
I can use other component of OpenNETCF but not the one I need: OpenNETCF.Net.Mail.
Simply my application doesn't compile when I add to the project a reference to OpenNETCF.Net.Mail.dll.
To get this problem it is enough to create a new SmartDevice project (VS2008, VB.NET, CF3.5) and in the property of the project to add a reference to OpenNETCF.Net.Mail.dll: the project doesn't compile any more. I just get a warning about a version conflict and no error:
Consider app.config remapping of assembly "System, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" from Version "2.0.0.0" [] to Version "3.5.0.0" [C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.dll] to solve conflict and get rid of warning.
C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3247: Found conflicts between different versions of the same dependent assembly.
Searching info about that warning I found that it is "safe" to ignore it because the OpenNETCF version that I'm using (2.3.12004.0) is compatible with CF3.5.
If I remove the reference to OpenNETCF.Net.Mail.dll and I add a reference to OpenNETCF.Windows.Forms.dll I get 5 warnings about remapping but the project compiles.
I have already posted this question in another forum without getting any answer, I hope here someone could help me.
Any suggestion is appreciated, also about other free component to send mail.
Thanks in advance.
|
|
|
|
 |
Hello everyone,
my application is a SmartDevice application and it runs on a device with Windows Embedded Compact 7 OS, so it relies on Compact Framwork 3.5.
Here is my problem (simplified): I have two forms, in the first form there is a Textbox and when it gets focus the second form pops up (I use form2.ShowDialog()).
The second form is a little numeric keypad that I use to write numbers in the textbox of the first form. This second form has also an OK button that close the form.
Is there a way to rise the TextChanged event of the textbox in the first form from the click event of the OK button in the second form (the OK button click doesn't write anything in the textbox)?
Thanks in advance.
|
|
|
|
 |
No, because the OK button Click code should not know ANYTHING about the form that created and showed it.
Since you're using ShowDialog in the parent form, you could just call the method that does whatever you have in the TextChanged event handler.
You DID move your TextChanged event code to a seperate method, correct? Don't put your work code in the event handler. Put it in its own seperate method and call that from the TextChanged event handler code. That way you can call it fdrom anywhere else you need to in your code without having to worry about how you're needlessly going to trigger events.
|
|
|
|
 |
Thanks Dave,
you have answered my question: I can't do what I wanted to do...
I have not moved my TextChanged event code to a seperate method, but I have an alibi!
In my application there are many textbox in different pages (UserControls) that call the same numeric keypad, so in the code in the keypad there is no reference to a specific method.
The keypad just knows which textbox is the caller and it writes in it.
It works but I wanted to improve it because the TextChanged event is raised anytime I write a digit from the keypad and not when I close the keypad clicking the OK button.
I wanted to do the opposite.
I can avoid the TextChanged event with a flag but to rise it by the OK button I have to use also this button to write something, for example I could write and delete a space.
Thank you.
|
|
|
|
 |
steve_9496613 wrote: I have not moved my TextChanged event code to a seperate method, but I have an alibi!
No you don't. It doesn't matter at all what the situation is. Moving the code to a separate method is always better than leaving it the event handler method. The sole exception being events that expect a return value in the form of a modified event argument, such as FormClosing.
If the keypad knows which control it's "typing" in that's OK and even useful in this case. The keypad doesn't necessarily need its own TextBox to type into, but does need some way of display the entered text without showing it in the target textbox. When OK is hit, the control then copies the text into the target TextBox thereby raising the TextChanged event in the target control only once.
|
|
|
|
 |
Dave Kreskowiak wrote: No you don't. It doesn't matter at all what the situation is. Moving the code to a separate method is always better than leaving it the event handler method. The sole exception being events that expect a return value in the form of a modified event argument, such as FormClosing.
...you make me feel guilty...!
I will keep in mind this rule but, please, can you explain me why it is always better?
In my specific situation the code in the event handler is executed only when the event raises, I mean I don't need to execute that code in any other place (and I think this is a common situation). I could create a new method, cut the code in the event handler and past it in the method and then call the method in the event handler but what is the benefit?
Dave Kreskowiak wrote: The keypad doesn't necessarily need its own TextBox to type into, but does need some way of display the entered text without showing it in the target textbox. When OK is hit, the control then copies the text into the target TextBox thereby raising the TextChanged event in the target control only once.
You are right, this could be a good idea.
I use this approach in a full alphanumeric keyboard that is too big to let the user see the field in witch he is typing but I had not thought of adopting this method for the numeric keypad.
Thank you.
|
|
|
|
 |
steve_9496613 wrote: what is the benefit?
The benefit is code reuse. Both in this project and in future ones. It's far easier to just call a method passing in the data it needs instead of trying to figure out how to call it, with the data it needs, and you have to bundle that into the two parameters that an event handler needs, sender and eventargs.
|
|
|
|
|
 |
function GetEqrDataUploadFiles()
{
var upload=$("#files").data("KendoUpload");
var s = upload.wrapper[0].childNodes[2].childNodes.length;
var a = new Array();
for (i = 0; i < s; i++)
{
if (document.all) {
a.push(upload.wrapper[0].childNodes[2].childNodes[i].innerText);
}
else {
a.push(upload.wrapper[0].childNodes[2].childNodes[i].textContent);
}
}
return a;
}
|
|
|
|
 |
If I'm not mistaken that looks more like Javascript.
If so then I think you will get a better answer in this forum Javascript[^]
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
 |
I'm looking for architectural advice for rewriting a small-business point of sale app that accesses both a remote SQL database and a local MySQL database. My biggest point of indecision lies in deciding what to use to access the remote database. I've been doing research, and have learned that I can use WCF, Web API, or simply use a good old fashioned .Net web service which is what is being used today via COM interop. I could simply remove the interop layer, and rewrite the service on the newer framework. This sounds good to me since I have experience with web services. Also, I do not need the ability to access the service from multiple platforms, as all of our stores will be operating on Windows 7 machines and I can install whatever I want on them. Performance is important but we only have in the neighborhood of 150 to 200 users accessing the SQL server at any given time. I want to do this right (I've been a developer for many years but not an architect!) and I have as much time as I need. I don't want the finished product to be obsolete as soon as its written. Oh, and one more thing...LINQ or not? Lots of complex queries in our app covering many tables per query and the local store database table names are dynamic - prepended with the current date. The remote database tables have fixed names. Any advice would be greatly appreciated.
|
|
|
|
 |
Make sure you write ~90% code coverage of the code in unit tests and your solution is unlikely to become obsolete.
Don't create dynamically named database table names. Not even locally. You will drive yourself insane trying to verify what should be happening at any point in time. Perhaps what you really need is a message queuing system instead? Look into MSMQ, SQL Server Service broker, or similar.
|
|
|
|
 |
how to import .dat file into database table
|
|
|
|
|
 |
You first have to know the format of the data in the file. ".DAT" is just a filename extension. It has no meaning and no impact on the format of the data in the file.
You either KNOW the exactly how the data is stored in the file or you need to find out. Without that, your project is dead before you even begin.
|
|
|
|
 |
Hi All,
I am looking for expert advice on printing the pdf files at client machine.
I have created a sample project named ClientPrint as
Imports System.Drawing
Imports System.Drawing.Printing
Imports System.Runtime.InteropServices
Namespace ActiveX
Public Interface IActiveXPrintLib
Sub PrintFile(filePath As String)
End Interface
<ProgId("ActiveX.PrintFile")>
<ClassInterface(ClassInterfaceType.AutoDual)>
<ComVisible(True)>
Public Class ActiveXPrintLib
Implements IActiveXPrintLib
<ComVisible(True)>
Public Sub PrintFile(filePath As String) Implements IActiveXPrintLib.PrintFile
Dim AcroPdf As New AcroPDFLib.AcroPDF()
AcroPdf.LoadFile(filePath)
AcroPdf.printAll()
End Sub
End Class
End Namespace
I have created the dll and register the dll using regasm command on client machine.
Now at time of consuming the print method at client side using javascript as
<object id="myControl1" name="myControl1" classid="clsid:ActiveX.ActiveXPrintLib"> </object>
var axComponent = new ActiveXObject("ActiveX.ActiveXPrintLib");
alert(axComponent);
if (axComponent == null) {
alert('Probably not installed');
}
else {
yourAxComponent.PrintFile('<%= Page.ResolveUrl("~/PdfTemp/0d818b57-9384-4f52-ae89-8ef5868064b7.pdf") %>');
alert('yes');
}
I am getting the error that automation server can't create object, using IE I have enabled the active x and permisssions to download the activex. but it still gives me same error.
I am not sure whether my code is correct or not.
Any advice is really helpful.
Thanks in advance.
|
|
|
|
|
 |
Hi,
Thanks for sharing the link, but information shared on this link is not complete and still I am facing same issue.
Thanks,
|
|
|
|
 |
Why we need Attribute in .net application ? Please give any real time example.
Thanks in Advance
|
|
|
|
 |