|
Surely a method can be private static.
The only thing I noticed in this code is that you wrote SqlException in two different ways (Sql <-> SQL) and that you didn't declare the strSProc parameter and don't have a return statement in InsertCategroyGroup.
|
|
|
|
|
Something can't be right here. There's nothing wrong with private static....
Regards,
Rob Philpott.
|
|
|
|
|
I'm not sure whether I understand correctly. Anyway, I believe that Static method, just like static member, can only be accessed via a class. Here, you can access the static class using "CategoryGroupDA.HandleSQLError(ex, strSProc)". And if you make a method dynamic (no "static" keyword), you need to create an instance of the class first and call the method via the instance.
KiT
|
|
|
|
|
I'm trying to serialize an instance of a class with members of type bool, string, double[], double, int and an enumeration declared serializable. The class is marked [Serializable()] and doesn't have any child objects aside from the primitives mentioned. Also, it doesn't extend any other class: It's declared:
[Serializable()]
public sealed class EQband
While serializing the object I get an error:
System.Runtime.Serialization.SerializationException: Type 'CtlEQ.CtlEQ' in Assembly 'bla, Version=2.0.2386.18258, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
I can't figure out why an attempt is made to serialize some instance of the CtlEQ class.
The class I'm serializing is declared within the same namespace and is used by the CtlEQ.CtlEQ class (CtlEQ holds a refference to EQBand), but is no member of it.
Does anyone know why this attempt is made and how I can prevent this from happening?
|
|
|
|
|
Just a wild guess: Do you have an event in EQband which CtlEQ listens to?
|
|
|
|
|
Errr. Yes... Does this matter?
|
|
|
|
|
Well if you bind an event of class A from class B then internally you are setting a reference from A to B.
Add the following to not serialize your event:
[field:NonSerializedAttribute()]
public event EventHandler FooEvent;
|
|
|
|
|
Allright, I had already set a method on [OnSerializing()] to set the event to null, following your last post. That worked, but I can see this is more graceful. Thanks for the help!
|
|
|
|
|
How to get notification if one particular file size Exceeds 10 MB. i tried FileSystemWatcher class but it giving Changed event which occur for every change. i want an event to be raise only if file size exceeds some mentioned amount. any help on this.
Thanks
srini
|
|
|
|
|
You can use FileInfo to get the length of the file. If FileInfo.Length bigger then 10MB then you must do something. Otherwise ignore it.
|
|
|
|
|
engsrini wrote: want an event to be raise only if file size exceeds some mentioned amount.
Then you need to create your own component to do this. A good starting place is to wrap a FileSystemWatcher, listen to its events, and when a particular one occurs (in your case a file being created/modified and its size being greater than 10Mb) fire your own event.
---
How to get answers to your questions[^]
|
|
|
|
|
Hi,
I'm trying to overlay some text onto a picture. Because the picture is a real scene, I don't know it's precise colour balance so i cannot pick a colour for the text which can always be seen.
so, i'd like to write text in black with a white border. that is, draw the text in white, then slightly smaller in black, on top of it.
But i cannot find a way of adjusting the font spacing in GDI+. I'm sure it's there, i just don't know where.
Without that, my two draws of text don't align properly.
Anyone know how to do this? or has done it before? or know a better way?
Thanks
Jon
using System.Beer;
|
|
|
|
|
Probably this site can help you:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/_gdiplus_obtaining_font_metrics_usecsharp.asp
|
|
|
|
|
Hi,
I'm just adding halo effects to one of my articles. This is the way to go:
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
GraphicsPath path = new GraphicsPath();
path.AddString("Sample text", base.Font.FontFamily, (int)base.Font.Style,
base.Font.Size * 3, new PointF(10, 10), new StringFormat());
using (Pen pen = new Pen(Color.White, 3))
{
e.Graphics.DrawPath(pen, path);
}
using (SolidBrush brush = new SolidBrush(Color.Red))
{
e.Graphics.FillPath(brush, path);
}
}
|
|
|
|
|
Hi,
I am facing a problem in my web application while i am trying to print an html page, whose url is specified in a textbox, using axWebBrowser component. I am getting an error "Exception of type InvalidActiveXStateException was thrown", at axW.Navigate statement. Please help me to rectify this problem.
private void Button1_Click(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
object empty= null;<br />
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(WebForm1));<br />
AxWebBrowser axW=new AxWebBrowser();<br />
axW.Enabled=true;<br />
axW.Visible=false;<br />
axW.OcxState = (System.Windows.Forms.AxHost.State)(resources.GetObject("axW.OcxState"));<br />
axW.Navigate(TextBox1.Text,ref empty,ref empty,ref empty,ref empty);<br />
axW.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER ,ref empty,ref empty);<br />
}<br />
catch(Exception Ex)<br />
{<br />
Response.Write(Ex.Message.ToString());<br />
} <br />
}
This application is a web application and I want the print at the server end since the server is the user in our case.
If it is not possible to print with this control in a web application, Is there any other way to print an html page without loading it and not to show any print dialog at the user end.
Please help me with this case.
Thanks in advance,
Sai.
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
onload in page write
It may help
vijay jain
|
|
|
|
|
i have 6 textboxes in my form
how will i check if these textboxes doesn't have same inputted values?
i have my own solution but seems to me that my could is quite long.
please help
thanks
|
|
|
|
|
private bool CheckTextBoxes()
{
foreach(Control control in this.Controls)
{
TextBox textBox = control as TextBox;
if(textBox != null)
{
foreach(Control otherControl in this.Controls)
{
TextBox otherTextBox = otherControl as TextBox;
if(otherTextBox != null)
{
if(!otherTextBox.Equals(textBox))
{
if(otherTextBox.Text == textBox.Text)
{
return false;
}
}
}
}
}
}
return true;
}
|
|
|
|
|
Hi, I'd do this:
private bool CheckTextBoxes(params TextBox[] textboxes)
{
bool result = true;
if (textboxes.Length > 0)
{
string standardText = textboxes[0].Text;
for(int i = 1; i < textboxes.Length; i++)
{
if (textboxes[i].Text != standardText)
{
result = false;
break;
}
}
}
return result;
}
Function usage:
bool equality = CheckTextBoxes(textbox1, textbox2, textbox3, textbox4, textbox5, textbox6);
|
|
|
|
|
I would like to be able to receive and send SMS in C#.NET. Please respond with sample or example of how i could accomplish this. I would especially love tutorials which i could read to acquire information/knowledge.
I have been trying to read to see if i could find out exactly how but to no avail. Hence i now seek your assistance.
Looking forward to lots of response.
Man's wisdom is a destructive tool.
|
|
|
|
|
Hello Mr. Unstoppable,
Have u seen this?
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
Read this article. Hope this helps.
My english is bad. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
|
Hello all, I am developing a touchscreen application. here i want to change windows default scrollbar sizes and messagbox sizes. in windows there are options to change these things (like rightclick on desktop go to DisplayProperties->Appearence->Scrollbar->Size = 36). How can i do this thru program. i am not able to find any APIs for this settings.
Please any one help me on this.
( intially i thought of customizing the scrollbar to big size but this drags me to the wild. late i found it is difficult to do .tats y i comes to this decision)
Thanks and Regards,
Srini
|
|
|
|