|
hi,
I am using following connection string but one ISAM error comes whenever I run the application.
Kindly check the mistake that, What am I doing wrong?
Thanx in Advance
(Riaz)
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="+ strDBPath +"stockmain.accdb;Jet OLEDB:Database Password=abc;SET EXCLUSIVE=OFF;");
|
|
|
|
|
|
Have you bothered to actually look at the full connection string once it got assembled?
and does strDBPath end on a backslash?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi,
I have an checkedListBox with 7 items :
1. a
2. b
3. c
4. d
5. e
6. f
7. g
I want to limit the user to choose only two , after 2 checkbox are checked i want it to be impossible to let the user to check another checkbox until he unchecked at least one of the checkbox that been checked.
Example :
private void checkedListBox_YAxisOptions_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Checked && this.ThereIsToMuchCheckBox() )
{
checkedListBox_YAxisOptions.SetItemCheckState(e.Index, CheckState.Unchecked);
MessageBox.Show("You can't choose more then 4 options!");
}
}
With this code i have a problem because every time i have a memory overflow problem.
How can i do it?
modified on Wednesday, August 12, 2009 8:24 AM
|
|
|
|
|
Check the selecteditems.count
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
In which event and if select one how can i stop him from select another one ?
|
|
|
|
|
Hi,
Your program should handle the ItemCheck event. The ItemCheckEventArgs has three properties, CurrentValue, Index and NewValue.
NewValue is the proposed new check state of the item at Index. Typically to prevent a change of check state one would write
e.NewValue = e.CurrentValue;
[EDIT] Just seen your modified post. There is no need for SetItemCheckState which is causing the event to be fired again and again etc. Just changing the NewValue is sufficient.
Alan.
|
|
|
|
|
|
i m doin an application in which on button click i want to browse my computer and get the file path and convert it to bytes
can any one help
This code was posted by me...
|
|
|
|
|
Use the OpenFileDialog[^] to get a path then convert it to string as follows...
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
string bytes = encoding.GetBytes("filepathhere");
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Dear Developers..
I have created one class ,defined public property of type "TabControl"
when i am trying to serialize it ,it gives error on this statement written in my form closing event.
XmlSerializer xmlSerializer = new XmlSerializer(SerializedClass.GetType());
There was an error reflecting type "projectname"
System.InvalidOperationException: There was an error reflecting type 'System.Windows.Forms.TabControl'. ---> System.InvalidOperationException: Cannot serialize member
Please suggest me solution ASAP
Thanking you,
|
|
|
|
|
|
You are not allowed to serialize controls/Forms!
|
|
|
|
|
Dear Hristo,
Thanks for reply..
So how can I load the previous state of applicaton.?
I am using multiple workspace(Tabpages) and each of them contains More than one instance of any form...
i need to save this and load it on application startup..
Thanking you..
|
|
|
|
|
Just define abstract settings set of your application and load/save it from
app configuration file.Here there is some useful help for you.
modified on Friday, August 14, 2009 6:58 AM
|
|
|
|
|
Hi all !
When the file is closed, i just want to know the file path.
I am using as bellow :
ManagementEventWatcher mngWatch;
WqlEventQuery wqlEQ;
wqlEQ = new WqlEventQuery("SELECT * FROM Win32_ProcessStartTrace");
wqlEQ.EventClassName = "Win32_ProcessStartTrace";
mngWatch = new ManagementEventWatcher(wqlEQ);
mngWatch.EventArrived += new EventArrivedEventHandler(mngWatch_EventArrived);
mngWatch.Start();
from this event creator i can get an Exe path not a File path :
1) in the Process.MainModule name contains the Exe path of the notepad
rather i want the real path from where the file is opened
2) For more clarity if i open a file form D:\\test.txt then i when the file is closed, i want to get that FILE PATH
can some one help me how to do that.
thanks a lot
Regards
.....Jack
|
|
|
|
|
You cannot get that information. Each application would have to expose its own events or other notification service to tell you that a document it was editing was closed. There is no such standard, so noone does it.
|
|
|
|
|
Hi,
I am working on a windows application involving MDI forms and child forms.
The problem here is when I click an item in the menu bar I am displaying a child form. the child form should be in such a way that it is displayed inside the MDI form and should not be like popup box.I have done this as shown below.
Childfrm.TopLevel=False;
this.Panel1.Controls.Add(Childfrm);
Childfrm.show();
it's working well but the controlbox with title bar is being displayed seperately in maximised mode.I want the control box beside MDI form menu and child form title beside mdi form title. A very good example of this functionality is Edit plus.
I request any one who worked on this type of requirement to help me in solving this problem
Thanks in advance
|
|
|
|
|
Try setting the IsMdiChild property of Childfrm to true, setting this.IsMdiContainer to true, and setting Childfrm.MdiParent to this
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Hi thanks for ur reply. but it's not not working.
The code is given below.
//childform.IsMdiChild = true;
childform.MdiParent = this;
childform.TopLevel = false;
splitContainer1.Panel2.Controls.Add(childform);
childform.Show();
the first line is giving an error saying "Property or indexer 'System.Windows.Forms.Form.IsMdiChild' cannot be assigned to -- it is read only".
|
|
|
|
|
If TopLevel is false, the form can no longer be an MdiChild.
|
|
|
|
|
but i need it since I should show the child window within the mdi form.It should not look like a popup window.
thanks and regards
|
|
|
|
|
Well, you're going to have to change your design. An MdiParent form cannot be an MdiChild to another MdiParent.
About the best you're going to get would be to write code that handles the Move and Resize events of the child form you want and contrain it to the boundries of the MdiParent's MdiClient area, or an MdiChild form's boundries. No, I don't have sample code because I've never needed to to anything like that.
|
|
|
|
|
Hi all!
I'm can't find a way to go through all the nodes in a treeNode tree.
I found some examples online but they don't do the job:
foreach (TreeNode myNode in myTreeView.Nodes[0].Nodes)
{
} the myTreeView.Nodes[0].Nodes has only one node and not all of the nodes in the treeNode tree
so does any one has a solution?
|
|
|
|
|
for (int get = 0; get < treeTable.Nodes.Count; get++)
{
TreeNode tn = treeTable.Nodes[get];
foreach (TreeNode tnp in tn.Nodes)
{
}
}
|
|
|
|