|
Sorry ! I typed that message in such a hurry that I could not re-read it even once. But yes what you have understood is correct. I have an update button and I want to update one row at a time when User clicks on Update. Is there a way in which you can get the foreign key in this case?
Another question I had is, when you have a table with composit primary key (3 columns in my case) and you have that as a foreign key in another table, how do you replace those (foreign key) composite columns by a combo box which will hold values for some other column from the primary key table ?
Thanks
- Rohit
|
|
|
|
|
Hi,
Has anybody used WM_PRINTCLIENT message?
I m using the following SendMessage call.....
SendMessage(hWnd, WM_PRINTCLIENT, (WPARAM) hDCMem, PRF_CLIENT | PRF_ERASEBKGND | PRF_CHILDREN );
but this returns a black window.
Any clues?
Thanks,
Puneet.
|
|
|
|
|
Hi all.
We are currently working on some software, that'll be distributed to a lot of customers - of our customer.
We need to show pdf files and make batch printing of them.
Anyone out there with a solution or knowledge of a component, that's capable of this?
It's important that it's royalty-free.
Thanks in advance!
Greetings,
Brian Dam
Tricon data A/S
Denmark
|
|
|
|
|
|
I have an array...
private void Page_Load(object sender, System.EventArgs e)
{
string [] dirs = Directory.GetDirectories(@"c:\inetpub\wwwroot\shares\folder\", "b*");
labelPath.Text=dirs.ToString();
}
as you can see it's value is assigned to the string "dirs"
now I want it to show up thought he label "labelPath", but when I compile the page it shows "System.String[]" ....
I need it to show the names of folders that start with "b", I can make it work as a consle application, but not a aspx page...
can somebody please help...???
/\ |_ E X E GG
|
|
|
|
|
|
string [] dirs = Directory.GetDirectories(@"c:\inetpub\wwwroot\shares\folder\", "b*");
I tried the Join Method but I can't get it to turn the above array "dirs" into a regular string that I can show though a label....
can you show me?
/\ |_ E X E GG
|
|
|
|
|
|
|
try
Console.WriteLine(String.Join('\n', dirs));
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
foreach(string x in Dirs)
{
labelPath.Text = labelPath.Text + x + "\n";
}
\\the "\n" is for newline! if you want a new line!
Leon v Wyk
|
|
|
|
|
Hi,
I'm looking for a (simple) way to write outlook plugins in c#. Unfortunatly I wasn't able to find any articles here on codeproject (even though I thought there was a competition in may/june).
Would be nice if someone could point me to the right direction!
TIA,
Daniel
--
SharpPrivacy - A free OpenPGP implementation in c#
http://www.sharpprivacy.net[^]
|
|
|
|
|
|
Can I send data through the parallel port in C#?
/\ |_ E X E GG
|
|
|
|
|
Hi there,
I would like to notify my app if a socketconnection is broken.
I tried to use a self created event, with wich i want to notify an upper class in such a case.
The problem is i receive a unhandled exception of type 'System.MissingMethodException'...
Why? What Am i doing wrong and what means this error?
Thanks a lot,
stonee
internal delegate void ConnectionHandler(SocketException se);<br />
............<br />
<br />
public class Control<br />
{<br />
<br />
<br />
internal event ConnectionHandler OnConnectionProblem;<br />
<br />
................<br />
<br />
<br />
public Control() <br />
{<br />
OnConnectionProblem+=new ConnectionHandler(ESControl_OnConnectionProblem);<br />
....................<br />
<br />
<br />
catch(SocketException se)<br />
{<br />
/<br />
MessageBox.Show (se.Message );<br />
try<br />
{<br />
OnConnectionProblem(se);<br />
}<br />
catch(MissingMethodException mme)<br />
{<br />
MessageBox.Show(mme.Message+"::"+mme.InnerException);<br />
}
|
|
|
|
|
Here's the problem:
stonee74 wrote:
OnConnectionProblem+=new ConnectionHandler(ESControl_OnConnectionProblem);
There's no method ESControl_OnConnectionProblem
Here's how I would do it:
public delegate void ConnectionHandler(object sender, SocketException se);
public class ConnectionProblemEventArgs
{
private SocketException m_SocketException;
public ConnectionProblemEventArgs(SocketException se)
{
SocketException = se;
}
public SocketException SocketException
{
get
{ return m_SocketException; }
}
}
public class EsControl
{
public event ConnectionHandler ConnectionProblem;
public virtual void OnConnectionProblem(SocketException se)
{
if (ConnectionProblem != null)
ConnectionProblem (this, new ConnectionProblemEventArgs (se));
}
private DoSomethingWithSocket()
{
try
{
...
}
catch(SocketException se)
{
OnConnectionProblem (se);
}
}
}
public class EventListner
{
public EventListner(EsControl esControl)
{
EsControl.ConnectionProblem += new ConnectionHandler (ESControl_ConnectionProblem);
}
private void ESControl_ConnectionProblem(object sender, ConnectionProblemEventArgs e)
{
}
}
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
thanks,
I'm sure this will work.
I have in my original class a method definition.
I still cannot understand the errormessage..
private void ESControl_OnConnectionProblem()<br />
{<br />
<br />
}
thanks for all inputs.
regards,
stonee
|
|
|
|
|
In Visual Basic, I can add multiple forms in a project and have a button (or other form controls) from one form bring up another form just by using the name of the form that I want to load followed by the Show method. For example,
formName.Show, secondForm.Show, or anotherForm.Show
Now is there a way to do something like this in C#?
|
|
|
|
|
FDL wrote:
Now is there a way to do something like this in C#?
You have to create an instance of the object you want to 'show'. Here is an example, About is the name of the form, ab is the name of the instance of About .
About ab = new About();
ab.Show();
-Nick Parker
|
|
|
|
|
Nick,
Thank you very much for your reply.
This is strange because I was doing something like what you did but it didn't work. Oh well, it works now. I must've just typed something wrong.
I really appreciate your help.
|
|
|
|
|
Nick pointed you in the right direction for C# but I want to comment on the VB side of things.
While VB allows you to do that, it isn't a very good idea to do it! The problem becomes evident when you have forms that become intertwined. In one application I made there was a relationship between clients and dealerships.
Using the formName.Show method worked fine until you opened up a client, then opened up the dealership from the client, and finally tried to open another client. You would get an error!
Instead, the proper way to do it is very similar to the C# way of doing it.
(Its been a few years since I've done VB6 so pardon any typos )
Dim myForm As New formName
myForm.Show
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
James,
Thanks for the advice. It is something that I'll definitely keep in mind and in my notes.
Francis
|
|
|
|
|
I'm having a problem making a User Control display upon a form in C#.
My form starts off with a single UC on it. Its called UCInit. UCInit contains some text and a couple of buttons. When one of the buttons is clicked, I want UCInit to remove itself from the form, and a second User Control, called UCCreate, to appear.
I can get rid of the first UserControl, but UCCreate never appears. This is my code so far for when the button in UCInit is clicks:
private void btnCreate_Click(object sender, System.EventArgs e)
{
this.Hide();
UCCreate newPanel = new UCCreate();
newPanel.Location = new Point (376, 8);
newPanel.Show();
}
UCInit removes itself but the instance of UCCreate never shows itself. What am I doing wrong?
|
|
|
|
|
You also need to do:
newPanel.Size=[whatever-the-size-is];
this.Controls.Add(newPanel);
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Still no love. This is my amended code:
private void btnCreate_Click(object sender, System.EventArgs e)
{
this.Hide();
UCCreate newPanel = new UCCreate();
newPanel.Location = new Point(376, 8);
newPanel.Size = new Size (280, 140);
this.Controls.Add(newPanel);
newPanel.Show();
}
|
|
|
|