|
Timestamp: 1/24/2009 7:33:57 AM
Message: Exception in call me method : Thread was being aborted.
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at ANAX_Dashboard.AnaxDashFrm.Callme() in E:\ANAX Dashboard working folder\ANAX Desktop Reports\ANAX Desktop Reports\FrmAnaxDashboard.cs:line 95
Category: Error
----------
when thread is abort
|
|
|
|
|
Post some code so we can analyze it a bit.
|
|
|
|
|
I thing, ManualResentEvent or AutoResendEvent are used in ur application.
but u r not handle write.This is my assumption.
|
|
|
|
|
anishkannan wrote: I thing, ManualResentEvent or AutoResendEvent are used in ur application.
but u r not handle write.This is my assumption.
DO NOT USE TEXT-SPEAK. It's RUDE.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi
Anybody help me......
how can create table layout on the panel.
A one panel split in to row and coloum and each table have the
unique name. futherly we want to access that panel table name wise.
Thankyou
|
|
|
|
|
Timestamp: 1/24/2009 7:30:50 AM
Message: Exception in call me method : Form that is already visible cannot be displayed as a modal dialog box. Set the form's visible property to false before calling showDialog.
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at ANAX_Dashboard.AnaxDashFrm.Callme() in E:\ANAX Dashboard working folder\ANAX Desktop Reports\ANAX Desktop Reports\FrmAnaxDashboard.cs:line 95
Category: Error
|
|
|
|
|
Happens for example if you call Show for a form and afterwards you try to call ShowDialog for the same instance. But without seeing the code, it's hard to say more.
|
|
|
|
|
Timestamp: 1/23/2009 11:56:54 AM
Message: Exception in call me method : Thread was being aborted.
at System.Drawing.SafeNativeMethods.Gdip.GdipImageSelectActiveFrame(HandleRef image, Guid& dimensionID, Int32 frameIndex)
at System.Drawing.Image.SelectActiveFrame(FrameDimension dimension, Int32 frameIndex)
at System.Drawing.ImageAnimator.ImageInfo.UpdateFrame()
at System.Drawing.ImageAnimator.UpdateFrames()
at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at ANAX_Dashboard.AnaxDashFrm.Callme() in E:\ANAX Dashboard working folder\ANAX Desktop Reports\ANAX Desktop Reports\FrmAnaxDashboard.cs:line 94
Category: Error
|
|
|
|
|
Reply to what? You didn't put in a question.
|
|
|
|
|
|
|
I am working in vb.net with c# - 2008
Hear Some Problem to fill Combobox using recursion in Duplication Problem in my combobox please help me
my table and coding like this
In table using Self join
*************** Table******************
Id Parent_Id Name
1 Null Sales
2 1 Item1
3 1 Item2
4 2 Item3
5 3 Item4
6 4 Item5
7 Null Purchase
8 7 Item1
9 7 Item1
My table data are look like that
1) in my application i want to fill only the Sales and that's child to releted with them in combobox
2) in my application i use to recursion that's work but that show many time the purticulr some items
3) if any budy have the solution of my problem please help me and if possible to give me code releted with otherwise give some example releted with it
please
|
|
|
|
|
So the data is duplicating in the combobox? Could you post the code you have currently. Without it, it's quite hard to say where the problem lies.
|
|
|
|
|
1)
public void FillCombo()
{
DataTable dt = new DataTable();
StrSql = "select Level_Id,Level_Name from UserLevel";
StrSql += " where Level_Id = '2'";
dt = qry.FillDataSet(StrSql).Tables[0];
if (dt.Rows.Count > 0)
{
if (ChildExistOrNotInCombo(2) == true)
{
AddChildCombo(2, ref dt);
}
}
this.cmbParentLevel.DataSource = dt;
this.cmbParentLevel.DisplayMember = "Level_Name";
this.cmbParentLevel.ValueMember = "Level_Id";
}
2)
private void AddChildCombo(int objid,ref DataTable Table)
{
DataTable Objdt = new DataTable();
int Objval = 0;
StrSql = "select Level_Id,Level_Name from UserLevel";
StrSql += " where Parent_LevelId = " + objid + "";
Objdt = qry.FillDataSet(StrSql).Tables[0];
if (Objdt.Rows.Count > 0)
{
for ( int i = 0; i <= Objdt.Rows.Count - 1; i++)
{
Table.ImportRow(Objdt.Rows[i]);
Objval = Convert.ToInt32(Objdt.Rows[i].ItemArray[0]);
if (ChildExistOrNotInCombo(Objval) == true)
{
AddChildCombo(Objval, ref Objdt);
}
}
}
}
3)
private bool ChildExistOrNotInCombo(int ObjParentId)
{
StrSql = "select * from userlevel where Parent_LevelId =
" + ObjParentId + "";
if (qry.CheckExist(StrSql) == true)
{
return true;
}
else
{
return false;
}
}
in my database this item has only 12 record but in this that retrun the 77 record in some are wrong but i dont't know please help me on this problem as soon as possible
|
|
|
|
|
The first thing is that why are you checking from database if item exists in combo in ChildExistOrNotInCombo? Shouldn't you be checking if the datatable you're filling contains the item?
Also it seems that you check from database if the row has children? I think it's unnecessary since you could simply call recursion. If there are no children, nothing's added.
You don't check how many rows your query returns in FillCombo. You use it like it returns 1, but if it returns several rows, I think you'll have extra data in the datatable.
And when you do the recursion, you select based on the row level_ID, is this correct? Shouldn't you select using Parent_ID like Parent_ID = ID (based on the data you posted in the first post)? So is Level_id same as ID in the first post and Parent_LevelId is the same as Parent_Id in the first post.
So basically it could be something like:
public void FillCombo()
{
DataTable dt = new DataTable();
StrSql = "select Level_Id,Level_Name from UserLevel";
StrSql += " where Level_Id = '2'";
dt = qry.FillDataSet(StrSql).Tables[0];
if (dt.Rows.Count > 0)
{
MessageBox.Show("More than one row");
}
AddChildCombo(2, ref dt);
this.cmbParentLevel.DataSource = dt;
this.cmbParentLevel.DisplayMember = "Level_Name";
this.cmbParentLevel.ValueMember = "Level_Id";
}
private void AddChildCombo(int objid,ref DataTable Table)
{
DataTable Objdt;
int Objval;
StrSql = "select Level_Id,Level_Name from UserLevel";
StrSql += " where Parent_LevelId = " + objid + "";
Objdt = qry.FillDataSet(StrSql).Tables[0];
for ( int i = 0; i <= Objdt.Rows.Count - 1; i++)
{
Table.ImportRow(Objdt.Rows[i]);
Objval = Convert.ToInt32(Objdt.Rows[i].ItemArray[0]);
AddChildCombo(Objval, ref Objdt);
}
}
|
|
|
|
|
1) But sir in my database there is no extra data my database data is show below
Hear is my Database
2 NULL Account
3 2 Perment
4 2 Tempray
11 NULL Sales
12 11 tttttt
13 11 pppp
14 12 qqqqq
15 13 jjjjj
16 15 asd
17 16 sasda
20 17 fffff
23 NULL Purchase
28 23 Pur1
30 20 qqqqqqq
31 14 aaaa
32 15 bbbbbbbb
33 32 iiiiiii
34 3 Company Employees
35 4 Contract Base Employee
2) i am trying as u say but that's are return the same thing as they return early
3) in my application i want to just add Parent data with the all child in my combobox if there are any other way to fill the combobox so please tell me
4) Example : The Sales is Parent Node and the that releted all child are fill in to the combobox with the Parnet Node
5) Hear the NULL is define that that is Parent Node.
|
|
|
|
|
I didn't say that the problem is in the data in the database, but how you use it.
One problem is that I don't know what your method qry.FillDataSet does. Perhaps it adds rows to an existing datatable? In that case you would have too much data.
Lets make it a bit simpler (I corrected few typos I made earlier):
Data
Level_Id ParentId Level_Name
-----------------------------
2 NULL Account
3 2 Perment
4 2 Tempray
11 NULL Sales
12 11 tttttt
13 11 pppp
14 12 qqqqq
15 13 jjjjj
16 15 asd
17 16 sasda
20 17 fffff
23 NULL Purchase
28 23 Pur1
30 20 qqqqqqq
31 14 aaaa
32 15 bbbbbbbb
33 32 iiiiiii
34 3 Company Employees
35 4 Contract Base Employee
public void FillCombo()
{
DataTable dt = new DataTable();
string sql = "select Level_Id, Level_Name from UserLevel"
+ " where Level_Name = 'Sales'";
dt = qry.FillDataSet(sql).Tables[0];
if (dt.Rows.Count > 1)
{
MessageBox.Show("Problem: More than one row");
}
AddChildCombo((int)dt.Rows[0]["Level_Id"], ref dt);
this.cmbParentLevel.DataSource = dt;
this.cmbParentLevel.DisplayMember = "Level_Name";
this.cmbParentLevel.ValueMember = "Level_Id";
}
private void AddChildCombo(int parentLevelId,ref DataTable Table)
{
DataTable childTable;
string sql = "select Level_Id,Level_Name from UserLevel"
+ " where Parent_LevelId = " + parentLevelId + "";
childTable = qry.FillDataSet(sql).Tables[0];
<code>-- Check with debugger that rows are correctly</code>
for ( int i = 0; i <= childTable.Rows.Count - 1; i++)
{
Table.ImportRow(childTable.Rows[i]);
AddChildCombo((int)childTable.Rows[i]["Level_Id"], ref Table);
}
}
Now use the debugger to see if row amounts and the data is correct in the FillCombo and also in the recursion.
|
|
|
|
|
Qry is a obj of my class
FillDataSet is one Common Function that's only fill the dataset or datatabel
In That the Data Will come is proper but Sir that Are Duplicate in to the combobox
Just Example the
1) 'qqqqq' That's are show in combo ManyTime that's way the some other data are also come the many times
Hear Sir Any Other Way to Fill the Combo
My one Friend Sid that that's to fillcombo with use Recursion is not give Proper Result and also say that that it is not proper way.
So if U know to the Other Way to Fill Combo so Please Tell Me That's Request Please
|
|
|
|
|
aajignesh wrote: In That the Data Will come is proper but Sir that Are Duplicate in to the combobox
Maybe a dumb question, but do you clear the combobox at any time? If not, you should add Clear to the FillCombo. Also you you may want to clear bindings. Like:
public void FillCombo()
{
<code>this.cmbParentLevel.DataSource = null;</code>
DataTable dt;
strinf sql = "select Level_Id, Level_Name from UserLevel"
+ " where Level_Name = 'Sales'";
dt = qry.FillDataSet(sql).Tables[0];
if (dt.Rows.Count > 1)
{
MessageBox.Show("Problem: More than one row");
}
AddChildCombo((int)dt.Rows[0]["Level_Id"], ref dt);
<code>this.cmbParentLevel.Items.Clear(); </code>
this.cmbParentLevel.DataSource = dt;
this.cmbParentLevel.DisplayMember = "Level_Name";
this.cmbParentLevel.ValueMember = "Level_Id";
}
aajignesh wrote: My one Friend Sid that that's to fillcombo with use Recursion is not give Proper Result and also say that that it is not proper way.
Recursion is just a technique to handle data which is in tree format. It can be used for many situations, like filling a combo. There's no reason why filling a combo with a recursion wouldn't work. The problem is in the implementation.
aajignesh wrote: So if U know to the Other Way to Fill Combo so Please Tell Me That's Request Please
This depends where the data is coming from. Are you querying for example SQL Server database?
|
|
|
|
|
I am use FillCombo to Form Load Event to FillCombo Box
Sir Hear Some Mistact Of my Coding But Hear I Dont't Find That.
If Sir U Have Any Other Idea to FillCombo so Plese Tell Me Please
|
|
|
|
|
aajignesh wrote: If Sir U Have Any Other Idea to FillCombo so Plese Tell Me Please
As I said, it depends where the data is coming from. Is it coming from SQL Server 2005 database? If it is one possibility could be to use recursive CTE (Common Table Expression).
However, I made a little sample on your data. Since I don't have your datasource I had to make it differently so the implementation is a bit different. Try this. As far as can see, it fills a combo named cmbTest as expected. If the result is what you want, modify it in little pieces to implement it the way that's suitable for you:
Start in form load
private void Form2_Load(object sender, EventArgs e) {
FillCombo();
}
Method to always get the same data
private DataTable GetDataTable() {
DataTable data = new DataTable();
data.Columns.Add("Id", typeof(int));
data.Columns.Add("ParentId", typeof(int));
data.Columns.Add("LevelName", typeof(string));
data.Rows.Add(2, null, "Account");
data.Rows.Add(3, 2, "Perment");
data.Rows.Add(4, 2, "Tempray");
data.Rows.Add(11, null, "Sales");
data.Rows.Add(12, 11, "tttttt");
data.Rows.Add(13, 11, "pppp");
data.Rows.Add(14, 12, "qqqqq");
data.Rows.Add(15, 13, "jjjjj");
data.Rows.Add(16, 15, "asd");
data.Rows.Add(17, 16, "sasda");
data.Rows.Add(20, 17, "fffff");
data.Rows.Add(23, null, "Purchase");
data.Rows.Add(28, 23, "Pur1");
data.Rows.Add(30, 20, "qqqqqqq");
data.Rows.Add(31, 14, "aaaa");
data.Rows.Add(32, 15, "bbbbbbbb");
data.Rows.Add(33, 32, "iiiiiii");
data.Rows.Add(34, 3, "Company Employees");
data.Rows.Add(35, 4, "Contract Base Employee");
return data;
}
Main point for recursion
public void FillCombo() {
DataTable dt = GetDataTable().Clone();
DataRow startRow = GetDataTable().Select("LevelName = 'Sales'")[0];
AddChildren((int)startRow["Id"], ref dt);
this.cmbTest.DisplayMember = "LevelName";
this.cmbTest.ValueMember = "Id";
this.cmbTest.DataSource = dt;
}
And the recursion
private void AddChildren(int parentId, ref DataTable TableToFill) {
DataRow[] children = GetDataTable().Select("ParentId = " + parentId.ToString());
for ( int i = 0; i <= children.Length- 1; i++) {
TableToFill.ImportRow(children[i]);
AddChildren((int)children[i]["Id"], ref TableToFill);
}
}
|
|
|
|
|
|
|
I have created a .dll and it has a .config file. The application which will call this .dll also will have a .config file. If within my .dll I have code such as:
string con = ConfigurationManager.ConnectionStrings["DB"].ConnectionString;
Does the .dll look in its own .config first and then looks in the app's .config or does it decide some other way?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
It looks the applications config file.
|
|
|
|
|