|
Thank you Mike, you are good man
sasa
|
|
|
|
|
What exactly are you trying to do?
If you want to return a code from your application change the signature of your application to static int Main() .
If that's not what you want, please show the related code especially the line with the given error.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I am trying to get the ReturnCode for an smtp mail that I am sending and if the mail doesn't go through than use a while loop to keep trying until it goes through.
SmtpMail.Send(msg);
sasa
|
|
|
|
|
AFAIK there is no return code so you will be out of luck here.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi there!
Please help, I am totally lost on this one. I have a service application that sends out emails every minute based on a sql output. The weird thing is I get 4-5 emails and then I get the above error and then again I get 4-5 mails and again get the above error.
Any suggestions please.
sasa
|
|
|
|
|
I am trying to accomplish Kerning, so far I have it somewhat working. By using the win32 function
[DllImport("gdi32.dll", EntryPoint= "SetTextCharacterExtra")]<br />
public static extern int SetTextCharacterExtra(IntPtr hdc, int nCharExtra);
I am getting spacing between characters. The issue is no matter what value I put for the nCharExtra parameter the spacing is always the same.
Here is how I am trying to do it.
win32.SetTextCharacterExtra(g.Graphics.GetHdc(), horizontalSpacing);<br />
g.ReleaseHdc();<br />
g.DrawString(holdText, this.Font, new SolidBrush(this.ForeColor), 0, 2);
I have also tried doing
IntPtr hdc = e.Graphics.GetHdc();<br />
Rect bounds = new Rect(e.ClipRectangle);<br />
<br />
win32.SetTextCharacterExtra(hdc, horizontalSpacing);<br />
win32.SetBkMode(hdc, win32.TRANSPARENT);<br />
win32.SetBkColor(hdc, ColorTranslator.ToWin32(Color.Black));<br />
win32.DrawText(hdc, holdText, holdText.Length, ref bounds, win32.DT_LEFT);
Does anyone know a solution to this issue, or another way in which I can accomplish Kerning?
Thanks,
Jeremy
|
|
|
|
|
hi i just learn c# and i got problem with my window programing i use microsoft acess as my database and i want to connect to my c# and i can connect it the problem is after that i update my database add a new colomn and in c# i cannot acess that new column
can u help me to solve the problem
thanks
|
|
|
|
|
If you start each sentence with a capital letter and end it with a period, it gets much, much easier to understand what you are writing.
What made you come to the conclusion that you can not access the new field?
---
b { font-weight: normal; }
|
|
|
|
|
wow - take a breath !!!
C# can absolutely access any column in your database. As it's access, it's an MDB file, right ? Are you pointing to the right copy, or an old copy that does not have that column ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi for example in first form i type code
string cusername = gempanDataSet.Table1[i].username;
i got the acess file named gempan
and i used it in the first form after that i go to form2 and want to use my database again but it got error
|
|
|
|
|
arifliminto86 wrote: but it got error
Sounds as if you need to post the code, so we can see what you're doing wrong. If the access file has the field in form1, but not in form2, I'd doubt you were using the same database, or perhaps you're not using the same query. You can select only some fields from a table, maybe that's your problem.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data.SqlClient;
namespace anggota
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void cmdexit_Click(object sender, EventArgs e)
{
MessageBox.Show(" BYE ");
Application.Exit();
}
private void cmdok_Click(object sender, EventArgs e)
{
bool matched = false;
bool matched2 = false;
Form f1 = new Form1();
for (int i = 0; i < gempanDataSet.Table1.Count; i++)
{
string cusername = gempanDataSet.Table1[i].username;
string cpassword = gempanDataSet.Table1[i].password;
matched = matched || (txtusername.Text == cusername);
matched2 = matched2 || (txtpassword.Text == cpassword);
if (matched && matched2) break;
}
if (matched)
{
MessageBox.Show("Username Correct");
}
else
{
MessageBox.Show("UNDETECTED username");
txtusername.Text = "";
}
if (matched2)
MessageBox.Show("Password Correct");
else
{
MessageBox.Show("Wrong Password");
txtpassword.Text = "";
}
executef2();
}
private void executef2()
{
Form2 f2 = null;
if (f2 == null)
{
f2 = new Form2();
f2.Show();
}
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'gempanDataSet.Table1' table. You can move, or remove it, as needed.
this.table1TableAdapter1.Fill(this.gempanDataSet.Table1);
}
.................................. this it form 1 and below is form2 called profile
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Data.OleDb;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace anggota
{
public partial class Profile : Form
{
public Profile()
{
InitializeComponent();
}
private void txtfn_TextChanged(object sender, EventArgs e)
{
string cpassword = gempanDataSet.Table1[i].password;
}
private void Profile_Load(object sender, EventArgs e)
{
this.table1TableAdapter1.Fill(this.gempanDataSet.Table1);
}
}
}
can u help me solve thanks
|
|
|
|
|
wow
arifliminto86 wrote: Form f1 = new Form1();
Why ?
arifliminto86 wrote: Form2 f2 = null;
if (f2 == null)
{
f2 = new Form2();
f2.Show();
}
Why ?
arifliminto86 wrote: this.gempanDataSet.Table1
Where is this data set filled ? It has the same name in Form1, but I don't see it being set in either. i.e. I don't see where this object is defined, so you'd expect it to be shared between forms of a different type.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi thanks for helping me.. actuall in form1 i already fill data with this code
this.table1TableAdapter1.Fill(this.gempanDataSet.Table1);
and i want to aplly again in my profile form but it doesnt work out.. do u know what code that i have to put ..?
thanks
form1:
-------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data.SqlClient;
namespace anggota
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void cmdexit_Click(object sender, EventArgs e)
{
MessageBox.Show(" BYE ");
Application.Exit();
}
private void cmdok_Click(object sender, EventArgs e)
{
bool matched = false;
bool matched2 = false;
Form f1 = new Form1();
for (int i = 0; i < gempanDataSet.Table1.Count; i++)
{
string cusername = gempanDataSet.Table1[i].username;
string cpassword = gempanDataSet.Table1[i].password;
matched = matched || (txtusername.Text == cusername);
matched2 = matched2 || (txtpassword.Text == cpassword);
if (matched && matched2) break;
}
if (matched)
{
MessageBox.Show("Username Correct");
}
else
{
MessageBox.Show("UNDETECTED username");
txtusername.Text = "";
}
if (matched2)
MessageBox.Show("Password Correct");
else
{
MessageBox.Show("Wrong Password");
txtpassword.Text = "";
}
executef2();
}
private void executef2()
{
Form2 f2 = null;
if (f2 == null)
{
f2 = new Form2();
f2.Show();
}
}
private void Form1_Load(object sender, EventArgs e)
{
this.table1TableAdapter1.Fill(this.gempanDataSet.Table1);
}
}
}
----------------------------------
form2:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace anggota
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
}
private void cmdaccount_Click(object sender, EventArgs e)
{
}
private void lblprofile_Click(object sender, EventArgs e)
{
executeprofile();
}
private void executeprofile()
{
Profile f2 = null;
if (f2 == null)
{
f2 = new Profile();
f2.Show();
}
}
}
}
-------------------------------------------------
profile :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Data.OleDb;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace anggota
{
public partial class Profile : Form
{
public Profile()
{
InitializeComponent();
}
private void txtfn_TextChanged(object sender, EventArgs e)
{
string cpassword = gempanDataSet.Table1[i].password;
}
private void Profile_Load(object sender, EventArgs e)
{
this.table1TableAdapter1.Fill(this.gempanDataSet.Table1);
}
}
}
|
|
|
|
|
arifliminto86 wrote: this.gempanDataSet[i]
No, I have no idea why it is that you can call this.gempanDataSet on two forms and expect them both to be the same object. I don't even see where i is being set ( maybe that's the problem ? ). Either way, some sort of global nastiness seems to be going on ( although that doesn't explain why you can use 'this' for gempanDataSet).
arifliminto86 wrote: Profile f2 = null;
if (f2 == null)
{
f2 = new Profile();
f2.Show();
}
Why do you keep doing this ? Did someone tell you it was a good idea ? It's pointless.
Profile f2 = new Profile();
f2.Show();
In any case, if you want to show a modeless dialog, f2 needs to be a member variable, not a local one.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi thanks for help me so far.. i already change i with 1 < just for example> but it still doesnt work.. and i already change my code with ur sugestion code.. thanks but i still dont understand why it still not working..
is it for c# we cannot call dataset in 2 form because i want to make like email program after i log in i can change my profile or my password thats why i need to use same database any suggestion plz help me.. sorry iam still beginer thats why sometime the way you talk i dont clearly understand
thanks
|
|
|
|
|
arifliminto86 wrote: is it for c# we cannot call dataset in 2 form
No, I pass datasets around all the time. The problem is that your code is broken. I still don't understand what you're doing and how. Do you?
arifliminto86 wrote: because i want to make like email program after i log in i can change my profile or my password thats why i need to use same database
Your data access should only occur in one place, as I've said, you should have a data layer in your code.
arifliminto86 wrote: sorry iam still beginer thats why sometime the way you talk i dont clearly understand
Sounds likely you're biting off more than you can chew. Too many people say things like 'I'm a beginner and I'm trying to write an email program'. If you can't understand the advice, you probably need to write something simpler first then come back to this project.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i am working in c# (.net2003)but i have a problem
i want to include system.collections.generic
but it is not working
how i will b able to include it
|
|
|
|
|
Hello
waheed awan wrote: it is not working
Why is it not working? What error do you get?
waheed awan wrote: how i will b able to include it
At the beginning of your file write
using System.Collections.Generics;
Regards
|
|
|
|
|
it doesnot allow it
when i write
using system.collections.
it gives only speciliazed option not generic
|
|
|
|
|
Nader Elshehabi wrote: At the beginning of your file write
using System.Collections.Generics;
He's using VS2003 though. That's .NET 1.1, which didn't include generics.
|
|
|
|
|
That is because generics are only available iwth .net 2.0 (2005). 1.1(2003) doesn't have them.
|
|
|
|
|
dan neely wrote: 1.1(2003) doesn't have them.
Yeah but nobody knows that because the hide information like that in the Documentation[^]
led mike
|
|
|
|
|
Really? Looking at the top of the documentation link you included I see:
Microsoft Windows SDK > .NET Framework 3.0 Development
I would not call that hidden and it definitely does not point back to version 1.1.
|
|
|
|
|
Yes, it's hidden. It's very common to hide information in places like that. Throughout history intellectuals have always hidden information in cleverly disguised places, like books, essays, articles, reference manuals and documentation. Places where no sane mane would ever look for it.
It's said that the best place to hide something is in plain view, and I believe that this goes for documentation on the web also. If the microsoft documentation had an url like http://www.killbill.org/misc, I think that a lot more people would know about it.
---
b { font-weight: normal; }
|
|
|
|