|
It's Easy.
If your application is using Database. You can use SQL Server or Oracle.If you can think then I Can.
|
|
|
|
|
Thanks for quick reply,
Data base point of view ok. I will use SQLServer.
i want to know,how to access access user interface. How to create shortcut on each desktop. So that my application should located in shared drive and access to every one.To invent something, you need a mountain of junk in your mind.
---------------------Thomas alva edison
|
|
|
|
|
You have a lot of question.
You can use MSaccess database but it's not friendly for MULTIUSER infrastructure. and you can connect server and other machines by using connection string.If you can think then I Can.
|
|
|
|
|
sampath-padamatinti wrote: How to create shortcut on each desktop.
Exactly the same way that you create any shortcut; the link will point to the app on the share rather than on the local disk.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
i want to validate first if the form is already loaded or not.
if it is already loaded the form will just prompt it again perform it windows state to normal and focus but does not duplicate the form..
<br />
<br />
<br />
private void newToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
<br />
<br />
if (IsFormLoaded("form2"))<br />
{<br />
return;<br />
}<br />
<br />
<br />
Form1 frmshow = new Form1(); <br />
frmshow.MdiParent = this;<br />
frmshow.Show();<br />
<br />
}<br />
<br />
private bool IsFormLoaded(string formName)<br />
{<br />
bool Load = false;<br />
<br />
for (int i = 0; i < (this.OwnedForms.Length) - 1; i++)<br />
{<br />
<br />
if (this.OwnedForms[i].Name.ToString().TrimStart() == "formName")<br />
{<br />
this.OwnedForms[i].WindowState = FormWindowState.Normal;<br />
this.OwnedForms[i].Focus();<br />
Load = true;<br />
}<br />
<br />
}<br />
<br />
return Load;<br />
}<br />
<br />
<br />
<br />
|
|
|
|
|
why are you using hardcoded form name
if (this.OwnedForms[i].Name.ToString().TrimStart() == "formName")
"formName" should be formNameLife's Like a mirror. Smile at it & it smiles back at you.- P Pligrim
So Smile Please
|
|
|
|
|
Please, don't repost a question so quickly. Your original question is only a couple of questions down, so be patient and post any updates to your question on that one. Don't start a new thread as this is rude."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
I had a setup (of plugin of IE) (named Setup1) build in vs2005. Earlier If I used to install this setup on other PC's which doesn't have vs2005 and has only .Net framework2.0, the setup gets successfully installed.
After few days, I had installed vs2008 in my PC. After that, I had took the code of Setup1, rebuilt the dll, made a setup (named Setup2) using vs2005.
The main thing is, I had observed one thing, the new setup (i.e., Setup2) gets successfully installed on developing machines, but it gives the following installation error on the machines which does not have vistualstudio, eventhough, .Netframework2.0 and windowsinstaller3.1 is present. The error is:
Exception occured while initializing the installation:
System.IO.FileLoadException: could not load file or assembly 'Microsoft.mshtml.dll, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. StrongName validation failed. (Exception from HRESULT:0x8013141A).
But on the same, Setup1 gets succesfully installed. But setup2 gives this installation Error.
If I run vs_piaredist.exe first and then run the Setup2, Setup2 also gets successfully installed.
Why is this happening with Setup2? why doesn't this happen with Setup1?
|
|
|
|
|
In my case it was because I referenced different "Microsoft.mshtml.dll" files (same file size, but different content). look at the Reference "Microsoft.mshtml.dll" , "Properties", "Path" field.
more details in myanswer to http://stackoverflow.com/questions/2068159/[^]Atara
|
|
|
|
|
Dear All:
I am a bit confused about the delegate with a returned value.
For example, I have a delegate as:
public delegate int Adelegate(MyClass instance)
Like this, what happens to the returned value if I use multi delegate please?
Further, if the delegate returns a bool, how can I declare a delegate that output a bool value please?
Should I declare it in the parameters or the return value?
ThanksAsura
|
|
|
|
|
|
<br />
private void newToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
<br />
if (IsFormLoaded("form1"))<br />
return;<br />
<br />
else<br />
{<br />
<br />
Form1 frmshow = new Form1();<br />
frmshow.MdiParent = this;<br />
frmshow.Show();<br />
}<br />
<br />
<br />
}<br />
<br />
private bool IsFormLoaded(string formName)<br />
{<br />
bool FormLoaded = false;<br />
<br />
for (int i = 0; i < (this.OwnedForms.Length) - 1; i++)<br />
{<br />
<br />
if (this.OwnedForms[i].Name.ToString().TrimStart() == "formName")<br />
{<br />
this.OwnedForms[i].WindowState = FormWindowState.Normal;<br />
this.OwnedForms[i].Focus();<br />
FormLoaded = true;<br />
}<br />
<br />
}<br />
<br />
return FormLoaded;<br />
}<br />
<br />
<br />
<br />
<br />
not functioning<div class="signature"><div class="modified">modified on Sunday, March 7, 2010 9:52 PM</div></div>
|
|
|
|
|
That would depend on what it's doing and what you expect it to do!
Or were we just supposed to read your mind?
|
|
|
|
|
So you modified your post and we are still supposed to guess what is not working and what you expect it do?Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
|
Off the top of my head, I'd guess you're missing a break; statement after setting FormLoaded to true .
/ravi
|
|
|
|
|
You Should First Compile it and Send the error message IF generate. Else Debug it Line By Line.
Best RegardIf you can think then I Can.
|
|
|
|
|
There are many ways to achieve a single instance form, and I suspect that the problem you are having is that the form name you are searching for doesn't exist in the OwnedForms collection."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
It looks like you might be missing a form in your loop.
DybsThe shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Hi,
I developed a simple application with C#, using the VSTO 2008 tools.
It is supposed to be used a mass-mailing item from Outlook 2007.
All it does is taking the mail recipients from the "To", "CC" & "BCC" and filter out the addresses which are either invalid or marked as non-subscribers. (There is a DB which stores all the email addresses)
The problem is not the logic inside, it works fine.
When the method is complete, the outlook starts to go crazy:
The icons at the bottom system tray flickers, CPU soars to 100% and the mail is stuck in the outbox.
Sometimes I can see the "Outlook is synchronizing folders".
Has anyone got the clue why is it happening?
I am attaching some of my code:
namespace SMOutlook2007AddIn
{
public partial class ThisAddIn
{
private Outlook.Application App = new Outlook.Application();
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
if (string.IsNullOrEmpty(ACCOUNT_NAME))
{
MessageBox.Show("Couldn't Load SM Addin.\n No ACCOUNT_NAME in config file.");
}
else
{
App.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(App_ItemSend);
}
}
private static ICollection<string> GetEmailsList(AddressEntry addressEntry)
{
if (addressEntry.DisplayType == OlDisplayType.olUser)
{
return new string[] { addressEntry.Address };
}
if (addressEntry.DisplayType != OlDisplayType.olPrivateDistList)
{
throw new System.Exception("Unknown Recipient Type " + addressEntry.DisplayType + "\nRecipient Name: " + addressEntry.Name);
}
if (addressEntry.Members == null || addressEntry.Members.Count == 0)
{
return new string[0];
}
List<string> addresses = new List<string>();
foreach (AddressEntry entry in addressEntry.Members)
{
addresses.AddRange(GetEmailsList(entry));
}
return addresses;
}
private static List<string> GetInvalidEmails(List<string> Emails)
{
if (Emails == null || Emails.Count == 0)
{
return null;
}
StringBuilder emailsList = new StringBuilder();
for (int i = 0; i < Emails.Count; i++)
{
emailsList.AppendFormat("'{0}'", Emails[i]);
if (i != Emails.Count - 1)
{
emailsList.Append(",");
}
}
List<string> invalidEmails = new List<string>();
string queryString = QUERY.Replace("{0}", emailsList.ToString().Replace("''","'"));
SqlCommand cmd = new SqlCommand();
cmd.CommandText = queryString;
cmd.Connection = new SqlConnection(ConfigurationManager.ConnectionStrings["StrongMail"].ConnectionString);
SqlDataReader dataReader = null;
try
{
cmd.Connection.Open();
dataReader = cmd.ExecuteReader();
while (dataReader.Read())
{
invalidEmails.Add(dataReader["Email"].ToString());
}
}
finally
{
if (dataReader != null && !dataReader.IsClosed)
{
dataReader.Close();
}
if (cmd.Connection.State == ConnectionState.Open)
{
cmd.Connection.Close();
}
}
return invalidEmails;
}
void App_ItemSend(object Item, ref bool Cancel)
{
Outlook.MailItem Mail = (Outlook.MailItem)Item;
if (!Mail.SendUsingAccount.DisplayName.Equals(ACCOUNT_NAME, StringComparison.OrdinalIgnoreCase))
{
return;
}
string[] toArray =
Mail.To == null ? new string[] { } : Mail.To.Split(new char[] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries);
string[] ccArray =
Mail.CC == null ? new string[] { } : Mail.CC.Split(new char[] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries);
string[] bccArray =
Mail.BCC == null ? new string[] { } : Mail.BCC.Split(new char[] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries);
Dictionary<string, Recipient> toDic = new Dictionary<string, Recipient>();
Dictionary<string, Recipient> ccDic = new Dictionary<string, Recipient>();
Dictionary<string, Recipient> bccDic = new Dictionary<string, Recipient>();
List<string> emailToCheck = new List<string>();
List<string> invalidEmails = null;
for (int i = 0; i < toArray.Length; i++)
{
toArray[i] = toArray[i].Replace(" ", "");
}
for (int i = 0; i < ccArray.Length; i++)
{
ccArray[i] = ccArray[i].Replace(" ", "");
}
for (int i = 0; i < bccArray.Length; i++)
{
bccArray[i] = bccArray[i].Replace(" ", "");
}
try
{
while (Mail.Recipients.Count > 0)
{
Recipient rec = Mail.Recipients[1];
Mail.Recipients.Remove(1);
List<Recipient> recList = new List<Recipient>();
ICollection<string> emailList = GetEmailsList(rec.AddressEntry);
foreach (string email in emailList)
{
Recipient newRec = Mail.Session.CreateRecipient(email);
if (!newRec.Resolve())
{
continue;
}
recList.Add(newRec);
if (!emailToCheck.Contains(newRec.Address))
{
emailToCheck.Add(newRec.Address);
}
}
if (Array.IndexOf(toArray, rec.Name) >= 0)
{
foreach (Recipient r in recList)
{
toDic[r.Address.ToLower()] = r;
}
}
if (Array.IndexOf(ccArray, rec.Name) >= 0)
{
foreach (Recipient r in recList)
{
ccDic[r.Address.ToLower()] = r;
}
}
if (Array.IndexOf(bccArray, rec.Name) >= 0)
{
foreach (Recipient r in recList)
{
bccDic[r.Address.ToLower()] = r;
}
}
}
invalidEmails = GetInvalidEmails(emailToCheck);
}
catch (System.Exception e)
{
Cancel = true;
MessageBox.Show(e.Message + "\nMailing Canceled", "Error Validating Emails");
return;
}
StringBuilder toList = new StringBuilder();
StringBuilder ccList = new StringBuilder();
StringBuilder bccList = new StringBuilder();
foreach (KeyValuePair<string, Recipient> kvp in toDic)
{
if (invalidEmails == null || !invalidEmails.Contains(kvp.Key.Replace("'", "")))
{
toList.AppendFormat("{0};", kvp.Key);
}
}
foreach (KeyValuePair<string, Recipient> kvp in ccDic)
{
if (invalidEmails == null || !invalidEmails.Contains(kvp.Key.Replace("'", "")))
{
ccList.AppendFormat("{0};", kvp.Key);
}
}
foreach (KeyValuePair<string, Recipient> kvp in bccDic)
{
if (invalidEmails == null || !invalidEmails.Contains(kvp.Key.Replace("'", "")))
{
bccList.AppendFormat("{0};", kvp.Key);
}
}
if (toList.Length == 0 && ccList.Length == 0 && bccList.Length == 0)
{
MessageBox.Show("All recipients addresses are invalid or unsubscribed.\nSend operation aborted.");
Cancel = true;
return;
}
Mail.To = null;
Mail.CC = null;
Mail.BCC = null;
if (toList.Length > 0)
{
Mail.To = toList.ToString().Substring(0, toList.Length - 1);
}
if (ccList.Length > 0)
{
Mail.CC = ccList.ToString().Substring(0, ccList.Length - 1);
}
if (bccList.Length > 0)
{
Mail.BCC = bccList.ToString().Substring(0, bccList.Length - 1);
}
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e) { }
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}
|
|
|
|
|
Do you know that your message contains 4.3479162 KiloMeters of characters?
And that it is unformated => hard to read?
|
|
|
|
|
unformatted ==> ignored.
|
|
|
|
|
To expand on what Luc said,
A ton of code and unformmated = ignored.Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
Hello,
I want to ask maybe somebody know.
How I Append String To Excel File????????
I have a command for that?Like "File.AppendAllText(stringfile,stringtoappend);"!!
ThankYou.
|
|
|
|
|
1) you can use OleDB
2) use interop
Here's one of many articles on that topic
|
|
|
|