|
Thanks for the pointers .
I solved the problem by completing the if .. else statement as follows:
bool startupCheckValue = true;<br />
startupCheckValue = checkCorrectDirectory();<br />
if (!startupCheckValue)<br />
{<br />
Application.Exit();<br />
}<br />
else<br />
{<br />
checkDBHasVersionControl();<br />
getDBVersionNumber();<br />
}
and moved it into the Form_OnLoad process.
Cheers ..
Glen Harvy
|
|
|
|
|
i posted about how to pass my parameter to Crystalreports and a person reply to me by this code :
crystalReport11.SetDataSource(MyDataSet);
crystalReport11.SetParameterValue("PrintDate1", "2006/05/07"); // this line that error occured
crystalReportViewer1.ReportSource = crystalReport11;
but the following error shown me :
Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
how to solve my problem and pass my parameter to crystalreports ?
thanks
|
|
|
|
|
I was looking for an approach to repaint a rectangle included on top of a control in the paint event handler. The paint event handler normally paints the whole control. If there is a rectangle on top of the custom control in the paint event handler that changes based upon which background image is provided for the control, how could I repaint that rectangle?
With Amar's assistance I was able to create and retrieve an extended property for the customized user control. Thus, the background image can be changed. However, now I need the rectangle in the paint event handler to be forcibly repainted.
I tried the ctrl.Invalidate() and ctrl.Refresh() and ctrl.Update methods in the _ctrl_BackgroundImageChanged(object sender, EventArgs e) event handler, but these approaches did not work. Any suggestions on how to repaint the clientRectangle that was created in the _ctrl_Paint event handler from the _ctrl_BackgroundImageChanged event handler?
I even tried to do the following:
public static Rectangle clientRectangle
private static void _ctrl_BackgroundImageChanged(object sender, EventArgs e)
{
Control ctrl = ((Control)sender);
ctrl.Invalidate(clientRectangle, true);
ctrl.Update();
ctrl.Refresh();
}
How do I repaint the entire control and any rectangle objects attached to the control?
-- modified at 17:09 Saturday 11th November, 2006
|
|
|
|
|
i need to know how i should load from image then read text on image
SUMA
|
|
|
|
|
Do some earching on OCR solutions.
---
b { font-weight: normal; }
|
|
|
|
|
can u help me more i searched many time on ocr tech. but i dont know which dll files supporrt this feature could u help???
SUMA
|
|
|
|
|
On my first search attemt I found a few...
http://www.xtras.net/categories/OCR/
http://www.freedownloadscenter.com/Programming/Components_and_Libraries/OCR__Net_Components.html
http://sourceforge.net/projects/tesseract-ocr/
http://www.leadtools.com/SDK/Document/Document-Addon-OCR.htm
http://www.programurl.com/ocr-net-components.htm
http://asprise.com/product/ocr/selector.php
http://www.softplatz.com/Soft/Development/Components-Libraries/OCR-Net-Components.html
http://www.download3k.com/Software-Development/Components-Libraries/Download-OCR-.Net-Components.html
Oh, and by the way, "plz help" is a really useless subject. Try to write a more descriptive subject the next time.
---
b { font-weight: normal; }
|
|
|
|
|
thx alot for your reply by the way to ask help is not something bad , any one start from scratch,and i tried many subject b4 but no responsed
thx again and sorry if title bothered u.
SUMA
|
|
|
|
|
suma12382 wrote: to ask help is not something bad
Of course not, but it has nothing to do in a subject line. Almost every thread here is about someone who asks for help, so the information has no value what so ever to distinguish the thread from other threads.
suma12382 wrote: and i tried many subject b4 but no responsed
I don't think that has much to do with the subject line. It's more likely because you don't even bother to try to write proper english. Txtspk is rather frowned upon in serious message boards, and some people simply ignore messages that contains "words" like "u", "plzzzzzz", "b4", "thx".
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for your comments,i will do it next time inshalla
SUMA
|
|
|
|
|
I'm pulling a lot of hair here - not much left, so kindly help.
I am trying to read and modify the contents of two tags (LoadBehavior and CommandPreload) in the following XML:
----------------
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
<Addin>
<FriendlyName>someaddin</FriendlyName>
[...]
<LoadBehavior>1</LoadBehavior>
<CommandPreload>1</CommandPreload>
[...]
</Addin>
</Extensibility>
----------------
My knowledge: I have a rough idea of what XML is, have no idea of the purpose of namespaces (other than making me hate XML more), and got the XML loaded into an System.XML.XmlDocument (yay!)
My problems:
============
(a) "navigation" in the presence of the namespace. Currently I do
---------------------
string nsname = "http://schemas.microsoft.com/AutomationExtensibility";
XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);
nsmgr.AddNamespace("xx", nsname);
node = xmlDoc.SelectSingleNode("/xx:Extensibility/xx:Addin/xx:LoadBehavior", nsmgr);
this works, but having to prefix "xx" to every element in the path seems counterintuitive, and make writing generig methods a pain. Any better way? (note that I have to live with the namespace)
(b) Replacing an element
----------------------
I want to modify these elements, but want to create them if they are not present.
Currently, I do:
XmlNode parent = xmlDoc.SelectSingleNode("/xx:Extensibility/xx:Addin", nsmgr);
if (parent != null)
{
node = xmlDoc.SelectSingleNode("/xx:Extensibility/xx:Addin/xx:CommandPreload", nsmgr);
if (node == null)
{
node = xmlDoc.CreateElement("CommandPreload", nsname);
parent.AppendChild(node);
}
node.InnerText = preload.Value ? "1" : "0";
}
That seems utterly verbose, as I have t mix in my own application logic, and my solution to getting the namespace right makes putting this into an isolated function utterly tricky.
|
|
|
|
|
I have a picture box, on which I detect mousemove events, and have the user draw on the picture box. Currently, I can save the image, but it's just plain white, without the actual drawing, any ideas where Im going wrong?
[CODE:]
private Graphics m_objGraphics;
private void pb_white_board_MouseMove(object sender, MouseEventArgs e)
{
Rectangle rectEllipse = new Rectangle();
if (e.Button != MouseButtons.Left) return;
rectEllipse.X = e.X - 1;
rectEllipse.Y = e.Y - 1;
rectEllipse.Width = 3;
rectEllipse.Height = 3;
m_objGraphics.DrawEllipse(System.Drawing.Pens.Black, rectEllipse);
Brush blackBrush = Brushes.Black;
m_objGraphics.FillEllipse(blackBrush, rectEllipse);
}
private void btn_save_whiteboard_Click(object sender, EventArgs e)
{
Bitmap bitmap = new Bitmap(pb_white_board.Width, pb_white_board.Height);
pb_white_board.DrawToBitmap(bitmap, new Rectangle(0, 0, pb_white_board.Width, pb_white_board.Height));
m_objGraphics.Save("image1.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
Thanks, Ben.
|
|
|
|
|
Two things...
1 - You are not dwawing on a PictureBox and
2 - You are trying to fetch drawn image from the PictureBox where painting has not taken place...
Cheers
|
|
|
|
|
Where is m_objGraphics created? I guess that you're creating the Graphics object somewhere during initialization of your code and then use it later, which is a big no-no!
To do it correctly you have to call methods on a Graphics object you get from the Image displayed in the PictureBox:
private void pb_white_board_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left) return;
Rectangle rectEllipse = new Rectangle(e.X - 1, e.Y - 1, 3, 3);
using (Graphics g = Graphics.FromImage(pb_white_board.Image))
{
g.DrawEllipse(System.Drawing.Pens.Black, rectEllipse);
g.FillEllipse(System.Drawing.Brushes.Black, rectEllipse);
}
pb_white_board.Invalidate();
}
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thanks, works a treat now
|
|
|
|
|
hi
i am use VC# 2005 and i want to connect to sqlserver 2000 from client to server,when i want to add datasource to my app and enter server name to
specific textbox and click Test connection the following error shown me :
Login failed for user 'VAZIRI-B8765F7F\Guest'.
I use Trusted Connection for connect to server
How to solve my problem ?
very thanks
|
|
|
|
|
Hi,
Are you sure that the credentials you supplied are correct ? (User name and password).
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hi
When you use trusted connection it means that you are connectiong to sql server using windows authentication which means that you are connectiong using the user name that you have logged on with.(In this case Guest user)
therefore you should define the guest user in your SQL Server.
If you like you can use user and password keywords in your connection string to use Sql authentication instead of a trusted connection then you can use a sql server user (for example sa) to connect to Sql Server
Regards
|
|
|
|
|
Plz compile these programs for me & do tell me where r the errors.
WAP to take 2 dates using objects(day,month,year)& display both dates,their comparison also that which one is greater(take the dates with the help of three parameter constructors)
class demo
{
DateTime dt1=new DateTime(Monday,November 06,2006)
DateTime dt2=new DateTime(Wednesday,November 08,2006)
if(DateTime.compare(dt1,dt2)<0)
{
System.Console.WriteLine("Second date is larger than the first");
}
else if(DateTime.compare(dt1,dt2)==0)
{
System.Console.WriteLine("Second date is same as the first date");
}
else
{
System.Console.WriteLine("Second date is smaller than the first date");
}
}
-------------------------
class demo
{
private DateTime getDate(int day, int month, int year)
{
return new DateTime(year, month, day);
}
private void compareDates(DateTime a, DateTime b)
{
if (a > b)
Console.WriteLine(a.ToShortDateString() + " > " + b.ToShortDateString());
else if (a == b)
Console.WriteLine(a.ToShortDateString() + " = " + b.ToShortDateString());
else
Console.WriteLine(a.ToShortDateString() + " < " + b.ToShortDateString());
}
}
---------------------------
WAP that counts the no. of occurence of particular character in a line of text.
class demo
{
private int Occurance(string Input, string Find)
{
System.Text.RegularExpressions.Regex rx =
new System.Text.RegularExpressions.Regex(Find);
// to display them do this
System.Text.RegularExpressions.Match mt = rx.Match(Input);
while (mt.Success)
{
Console.WriteLine("Found >>" + Find + "<< at position " + mt.Index.ToString());
mt = mt.NextMatch();
}
// end display
return rx.Matches(Input).Count;
}
}
|
|
|
|
|
What?
Why don't you compile them yourself? You can use Visual Studio Express or the .NET Framework SDK to compile from command prompt. You can then easily check the errors and fix them.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I don't have compiler or Visual Studio at home.I have also tried to download SDK from microsoft but it is giving errors.
sorry for the inconvenience.
-- modified at 12:51 Saturday 11th November, 2006
|
|
|
|
|
It's pretty clear why this doesnt compile. Only variables, properties and methods can be placed inside a class. Everything else should be inside methods.
class Class1
{
public static void Main(String[] args)
{
}
}
WM.
What about weapons of mass-construction?
|
|
|
|
|
I didn't even try to compile the mess, I just looked at it. That's why the error messages are more to the point than the ones you would get from the compiler:
DateTime dt1=new DateTime(Monday,November 06,2006)
Variable 'Monday' is not defined.
'November 06' is not a valid expression.
There is no constructor for the DateTime structure that takes those arguments.
DateTime dt2=new DateTime(Wednesday,November 08,2006)
Variable 'Wednesday' is not defined.
'November 08' is not a valid expression.
There is no constructor for the DateTime structure that takes those arguments.
if(DateTime.compare(dt1,dt2)<0)
The operator is "Compare", not "compare".
Friend4u wrote: else if(DateTime.compare(dt1,dt2)==0)
The method is named 'Compare', not 'compare'.
---
b { font-weight: normal; }
|
|
|
|
|
Is there a way to specify a type contraint that operator== is supported?
or any way to deal with that?
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify! || Fold With Us! || sighist
|
|
|
|
|
Off the top of my head, I can only think of:
where T : System.IComparable<T>
Geor
|
|
|
|