|
Hi,
I don't think the Me.Invoke line is causing the problem; what it does is cause a thread switch, so your breakpoint/single-stepping debugging techniques probably got confused. I would suggest you put one big try-catch inside sub MergeFinished() , which then shows the Exception.ToString() that is probably occuring. My guess is something actually goes wrong inside RecieveData()
|
|
|
|
|
I have an access table containing several records. Infact records of universities alongwith their fee structure.
The task is to sort out the universities according to a given range and display that list in VB 2008 form.
Has anybody got any reference regarding this?
|
|
|
|
|
This sounds like homework and this little "how-to" has been documented hundreds of thousands of times. All it takes is a little Googling: "vb.net get data from access[^]".
|
|
|
|
|
I have several group boxes on top of one another but the problem i am facing is their merging with each other. How can it be avoided?
|
|
|
|
|
What do you mean by merging with one another? they can't do that.
|
|
|
|
|
i am trying to make a working simple calculator in VB.
i have 4 errors that i just can not figure out to save my life. can anyone help
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace projectfinal
{
public partial class Calculator : Form
{
bool Plus = false;
bool Sub = false;
bool Multiply = false;
bool Divide = false;
bool equals = false;
public Calculator()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{ //clears textbox and starts new problem
if (equals)
{
textBox1.Text ="";
equals = false;
}
textBox1.Text = textBox1.Text + "1";
}
private void button2_Click(object sender, EventArgs e)
{
if (equals)
{
textBox1.Text ="";
equals = false;
}
button2.Text = button2.Text + "2";
}
private void button3_Click(object sender, EventArgs e)
{
if (equals)
{
textBox1.Text ="";
equals = false;
}
button3.Text = button3.Text + "3";
}
private void button4_Click(object sender, EventArgs e)
{
if (equals)
{
textBox1.Text = "";
equals = false;
button4.Text = button4.Text + "4";
}
}
private void button5_Click(object sender, EventArgs e)
{
if (equals)
{
textBox1.Text ="";
equals = false;
}
button5.Text = button5.Text + "5";
}
private void button6_Click(object sender, EventArgs e)
{
if (equals)
{
textBox1.Text ="";
equals = false;
}
button6.Text = button6.Text + "6";
}
private void button7_Click(object sender, EventArgs e)
{
if (equals)
{
textBox1.Text ="";
equals = false;
}
button7.Text = button7.Text + "7";
}
private void button8_Click(object sender, EventArgs e)
{
if (equals)
{
textBox1.Text ="";
equals = false;
}
button8.Text = button8.Text + "8";
}
private void button9_Click(object sender, EventArgs e)
{
if (equals)
{
textBox1.Text ="";
equals = false;
}
button9.Text = button9.Text + "9";
}
//dont want more than one decimal on the screen
private void buttonDecimal_Click(object sender, EventArgs e)
{
if (equals)
{
textBox1.Text = "";
equals = false;
}
if (buttonDecimal.Text.contains("."))
{
return;
}
else
{
buttonDecimal.Text.contains + ".";
}
}
//if already neg it will become pos
private void buttonNeg_Click(object sender, EventArgs e)
{
if (buttonNeg.Text.contain("-"))
{
textBox1.Text = textBox1.Text.Remove(0,1);
}
else
{
textBox1.Text = "-" + textBox1.Text;
}
}
private void buttonPlus_Click(object sender, EventArgs e)
{
if(textBox1.Text=="")
{
return;
}
else
{
Plus = true; //adding something
textBox1.Tag = textBox1.Text;//stores number
textBox1.Text = "";
}
}
private void buttonEquals_Click(object sender, EventArgs e)
{
equals = true;
if(Plus)
{
Decimal dec = Convert.ToDecimal(textBox1.Tag) + Convert.ToDecimal(textBox1.Text); //1st and 2nd value
textBox1.Text = dec.ToString();
}
if (Multiply)
{
Decimal dec = Convert.ToDecimal(textBox1.Tag) * Convert.ToDecimal(textBox1.Text); //1st and 2nd value
textBox1.Text = dec.ToString();
}
if (Sub)
{
Decimal dec = Convert.ToDecimal(textBox1.Tag) - Convert.ToDecimal(textBox1.Text); //1st and 2nd value
textBox1.Text = dec.ToString();
}
if (Divide)
{
Decimal dec = Convert.ToDecimal(textBox1.Tag) / Convert.ToDecimal(textBox1.Text); //1st and 2nd value
textBox1.Text = dec.ToString();
}
}
private void buttonSub_Click(object sender, EventArgs e)
{
if(textBox1.Text=="")
{
return;
}
else
{
Sub = true; //adding something
textBox1.Tag = textBox1.Text;//stores number
textBox1.Text = "";
}
}
private void buttonDivide_Click(object sender, EventArgs e)
{
if(textBox1.Text=="")
{
return;
}
else
{
Divide = true; //adding something
textBox1.Tag = textBox1.Text;//stores number
textBox1.Text = "";
}
}
private void buttonMultiply_Click(object sender, EventArgs e)
{
if(textBox1.Text=="")
{
return;
}
else
{
Multiply = true; //adding something
textBox1.Tag = textBox1.Text;//stores number
textBox1.Text = "";
}
}
private void buttonclear_Click(object sender, EventArgs e)
{
Plus= Sub = Multiply = Divide = false;
textBox1.Text = "";
textBox1.Tag ="";//clear stores number
}
}
}
|
|
|
|
|
Some suggestions:
1. Put your code between <pre></pre> tags for readability; use the "code block" button in this editor.
2. Tell us what the errors are, we cannot see the output of your compilation from here, nor can we guess what might be going wrong.
It's time for a new signature.
|
|
|
|
|
on top of what Richard said, don't enter that amount of code all at once; start with a subset and get that working; working more incrementally will save you lots of time, so you can learn while doing, and not repeat earlier mistakes. I compile and run every two minutes, and I don't add code when what I have isn't working already to some extent.
|
|
|
|
|
terrable wrote: i am trying to make a working simple calculator in VB
I think you're biggest problem is that the code you provided is actually C# and not VB
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Steven J Jowett wrote: I think you're biggest problem is that the code you provided is actually C# and not VB
We have a winner!
|
|
|
|
|
I want to know the meaning of the code
Obj_aCrc = Obj_aCrc + Val(CStr(Asc(Mid(strVal, Obj_i + 1, 1)) * (Obj_i Mod (5) + 1)))
Thanks
|
|
|
|
|
When you cross-post, you should remove the original question, otherwise you'll be flamed.
Anyway the answer's Here.[^]
|
|
|
|
|
Michel Godfroid wrote: When you cross-post, you should remove the original question, otherwise you'll be flamed.
Then he'd also be flamed, for removing a question that already has an answer. Anyway, he got the hint to post here, and he did.
Some days it's just impossible to avoid the bullets, I guess
I are Troll
|
|
|
|
|
skskhoukhita2010 wrote: I want to know the meaning of the code
It's a crc[^]-check.
Val returns the numerical content of a string
CStr does the same thing as the .ToString() method
Asc returns the ASCII value of a character
Mid returns a subsection of a string
Mod divides two numbers and returns the remainder
I are Troll
|
|
|
|
|
|
Hi,
I have worked email option in vb6.0.
Its only working for gmail smtp server.
I want to sent from my offical mail server...
Plz Help me...
This is code for ur knowldge...
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = txtUsername.Text
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = txtPass.Text
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = txtPort.Text
.Update
End With
'strbody = "Your Sample message "
With iMsg
Set .Configuration = iConf
.To = txtTO.Text
.CC = txtCC.Text
.BCC = txtBCC.Text
.From = txtUsername.Text
'.From = "<your mailid to be displayed as@gmail.com>"
.Subject = txtSUb.Text
.TextBody = txtBody.Text
.Send
MsgBox ("Sent")
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
Google is your friend, also there are lots of articles, go inspect the archives here.
And why VB6?
Such ancient hieroglyphs have long since been replaced with VB.NET, it is easier to do mail with that.
eg just use mailto: command.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
What is the point of answering the OP in such a fashion ? Do you honestly think that your answer is going to help the OP, or CodeProject for that matter, with your reply, seriously. Some people have the unenviable task of maintaining legacy apps written in out of date languages. This has nothing to do with their skill as a programmer, or their value as a Code Project member, just a basic fact of life. The OP asked a genuine question (to which you obviously have no knowledge of the language he is using or the methods that he is trying to use ), he also showed us his code he working on, and explained his problem in terms anyone could understand. I realise that you are an accountant, and not a programmer, but if you go through your answers that you are providing on this forum, I feel that maybe until Code Project opens up an accounting Forum, you should stick to the lounge where your contributions are much more appreciated. I realise you are one of the more popular memebers here, and that I will probably be blazed by Liquid Nitrogen for even daring to express my opinion, but I really don't care. It is answers like this that are pushing me away from this Site, and it is unnecessary.
|
|
|
|
|
zimvbcoder wrote: Do you honestly think that your answer is going to help the OP, or CodeProject for that matter, with your reply, seriously.
If the OP goes and searches google / CP for the answer it has helped him.
zimvbcoder wrote: Some people have the unenviable task of maintaining legacy apps written in out of date languages.
True, but DD asked why he was using VB6. In my opinion a valid question. If the OP responds with 'it's a legacy program' then we can move on. But if he responds with 'it's the only thing I know for this new program' we can tell him not to use it and spend some time learning .NET since VB6 isn't supported anymore.
zimvbcoder wrote: I realise you are one of the more popular memebers here, and that I will probably be blazed by Liquid Nitrogen for even daring to express my opinion, but I really don't care. It is answers like this that are pushing me away from this Site, and it is unnecessary.
My supply of liquid Nitrogen has run out so... . Seriously tho I don't think your gonna get flamed for just expressing your opinion.
As to being pushed away from this site, why? If the answer(s) you get don't apply or answer the question ask for more explanation. If it was insulting vote appropriately (also if not insulting)
If the answer is truly so bad that you feel personally attacked go to 'site bugs / suggestions' and ask Chris to have a look at it.
|
|
|
|
|
Tom Deketelaere wrote: If the OP goes and searches google / CP for the answer it has helped him.
Yah, teach a man to make fire, or set a man to fire - it's always a dilemma
Tom Deketelaere wrote: True, but DD asked why he was using VB6. In my opinion a valid question.
I can understand where the sentiment is coming from; nearly every VB6-question has two or three answers stating that one should "move on", whilst the programmer rarely has a choice in the language being used.
Tom Deketelaere wrote: since VB6 isn't supported anymore.
It's no longer actively supported by Microsoft. The community however, is a somewhat different beast. I'd even support 16-bit Delphi apps if required
Tom Deketelaere wrote: If the answer is truly so bad
Some of our members talk/type with an enormous passion for this trade, and sometimes that gets confused with anger. The arguments are the best proof that they care about what they do
I are Troll
|
|
|
|
|
Eddy Vluggen wrote: Yah, teach a man to make fire, or set a man to fire - it's always a dilemma
Where's the dilemma? It's always set a man to fire
Eddy Vluggen wrote: I can understand where the sentiment is coming from; nearly every VB6-question has two or three answers stating that one should "move on", whilst the programmer rarely has a choice in the language being used.
True, but it doesn't hurt to ask why he is using VB6, like I said if the answer is, it's the only thing I know for this new program, then we can tell him to move on.
I understand supporting legacy program's all to well (have one left that I haven't converted yet so ...) but new program's shouldn't be written in vb6
Eddy Vluggen wrote: It's no longer actively supported by Microsoft. The community however, is a somewhat different beast.
Are you calling Bob a beast? (watch out for those hamsters now)
Eddy Vluggen wrote: I'd even support 16-bit Delphi apps if required
Showing your age here?
|
|
|
|
|
Tom Deketelaere wrote: Where's the dilemma? It's always set a man to fire
Efficiency. If you teach a man to make fire, then he can set others' around him on fire
Tom Deketelaere wrote: it doesn't hurt to ask why he is using VB6, like I said if the answer is, it's the only thing I know for this new program, then we can tell him to move on.
That would be on the assumption that there's an option. He might have the time to learn something new, or perhaps one of the managers doesn't like the idea of a .NET framework on their clients.
Tom Deketelaere wrote: but new program's shouldn't be written in vb6
Not from a programmers perspective
I are Troll
|
|
|
|
|
I think you have over reacted to Dave's post as his points are valid. I also do think you are right in what you have said and Dave could have phrased him point better.
Yes, VB6 is effectively obsolete, and has been since the release of VB.NET in 2002.
"I'm coding for a legacy VB6 system", is not necessarily a valid excuse for coding in VB6. If I was adding a new module to a legacy VB6 project, I would write the new module in .NET and make it COM visible, especially where the .NET functionality, for the task required, is far better than that of VB.6, which in the case of email, it is.
At the end of the day, as a programmer/developer, the language you should use is that that best fits the project requirements.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Actually it is an ongoing problem with Indian Based members.
I would estimate (fairly accurately and conservatively) that most (90%) questions that require VB6 as a solution are generated from our Indian brethren.
I have a theory about that.
I think that Indian schools/colleges only have vb6 software.
For some reason (probably financial), they have not moved on to VB.NET, and thus they are teaching VB6.
This is evident in the afternoons (London Time) when the 'kids' are CPing their homework.
(Even more so when end of term projects have to be handed in).
So my moan about VB6 is valid, perhaps the Indian Education authorities ought to use some of the Many Billions of Pounds that Britain gives them every year to upgrade the teaching software rather than do Space Launches.
As for my bitching about google, it too is a valid point.
Before I ask for help here I have googled and attempted, and for such topics as Mailing, I googled and found several million sites dedicated to the problem.
Why you think I was being difficult I do not know.
As for you assertation about legacy code, rubbish!
Additional requirements can still be written in VB.Net and applied to old code.
And if a module needs to be rewritten, then rewrite, the skeleton is there in VB6, so it is only rejigging rather than a 'From Scratch'.
Thanks for keeping me on my toes though.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
If your code works fine with google as you say, then i suspect there is a configuration difference between your official mail server and google.
What is your official mail server?
Does it use the same port?
Does it use the same authentication?
Answer those and we might be able to help more.
P.S. if you are developing a new application, or are learning, then it is time to move to a .Net language. VB6 is almost obsolete, and should only be used to support legacy apps, not new stuff.
|
|
|
|
|