|
Edit your message. Put the code in tags: <pre lang="c#">Your Code Here</pre>
Ciao,
luker
|
|
|
|
|
Try using the debugger (set a break point) to find the line where the code fails. I suspect it is the query to the database which fails 3 times!
Next do not use sa as your credentials to the database, even during development, create a SQL identity and use that. It is good that you are using sql parameterised queries!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The storedprocedures have you tried to execute them in SQL Server Management studio?
I suspect that your SQL Stored procedures are not returning any values hence not filling up the dataset(s)
I would have a read of these to see how to test the dataset is empty or not
How to test if a DataSet is empty?[^]
how to check if a dataset is empty? whats the correct c# syntax to use?[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Hi,
This is little bit of a oops question. As I am not a full time programmer, I am struggling with little bit of basics. any kind of favor would be appreciated.
namespace NameSpaceX.DataModel
{
class BFPFDataObject
{
public WDataObject thisObject { get; set; }
List<BFPFDataObject> children = new List<BFPFDataObject>();
public IList<BFPFDataObject> Children
{
get { return children; }
}
public BFPFDataObject(WDataObject wdoObj)
{
thisObject = wdoObj;
List<WDataObject> wdoDBContents = PFAPIUtils.GetContents(wdoObj, false);
foreach (WDataObject tempobj in wdoDBContents)
{
BFPFDataObject _children = new BFPFDataObject(wdoObj);
children.Add(_children);
}
}
}
}
I would like to know if its a legitimate class definition
WDataObject is the object what i get from a third part lib
using this I can make calls and navigate the tree
List<WDataObject> wdoDBContents = PFAPIUtils.GetContents(wdoObj, false);
above function that do this for me,
However if pass the second parameter to be true, then the function make recursive call and return a list which is all in the same hierarchy.
if the parameter is false then it return only the list objects in the next level.
I am struggling to build a hierarchical list and show it on a tree view, can some body offer some help ?!!!
My gut feeling is if I can build the list sucessfully as indicated above I would be able to do the WPF part myself.
Please throw some light on the subject
Regards
Krish
|
|
|
|
|
The standard color dialog lets you select from a pallette of fixed colours or, if you click the define custom colors button, you can select your own variations. Now, compare this to say the BackColor of a button. that lets you select from three tabs, Custom, Web and system. If you click the Web tab you can select colours by name such Fuschia, Goldenrod, and what have you.
I'm creating a property editor for a custom control and I'd like to implement something similar. I know I could have a form in my property and have a ColorDialog on it but I like the idea of selecting colours by name which ColorDialog can't do. Does anyone know of some easier way to do this at the custom level or perhaps knows of a freeware component I could use that does.
Another way I could approach it is to run through the KnownColor enumeration and then get the colou's ARGB values and then somehow perhaps have a listbox and paint small rectangles in it with the colour and its name. I guess it's do-able but hardly convenient.
Anyone have any ideas I can investigate and research further?
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
|
Thanks Zac. I'll download it and see if I can pull out the ColorPicker as that's what I want.
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
I can upload the source to a color picker dialog I made with the control if you want me to.
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
Yes please, buddy. I'd appreciate that.
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
Here you go![^]
The file is the ColorDialogEx.zip one.
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
Many thanks, Zac. I've downloaded it and I'll look at implementing it into the control I've been working on.
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
No problem.
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
Zac, I ran into a problem which I'll explain. I downloaded the ColorDialogEx, unzipped it and loaded the solution in VS2012, compiled it, successful. There were a couple of minor warnings telling me == and != were implemented but no override for Object.Equals and Object.GetHashCode have been defined, but nothing serious.
I then created a new winform app in 2012 and I added the ColorDialogExe.dll to the General toolbox category. It added a few components. I selected the ColorPickerCombobox component and dropped it on the form. It shows correctly. I didn't change any of the properties, etc.
When I run the app it throws an exception in ImagesUtil's GetToolbarImageList. Here's an extract of the exception:
System.ArgumentException was unhandled
HResult=-2147024809
Message=Resource 'ColorPicker.Resources.popupcontainerbuttons.bmp' cannot be found in class 'resfinder'.
Source=System.Drawing
StackTrace:
at System.Drawing.Bitmap..ctor(Type type, String resource)
at ColorPicker.ImagesUtil.GetToolbarImageList(Type type, String resourceName, Size imageSize, Color transparentColor) in c:\Temp\ColorDialogEx\ColorDialogEx\Resources\Images.cs:line 13
at ColorPicker.PopupContainerImages.ImageList() in c:\Temp\ColorDialogEx\ColorDialogEx\Resources\Images.cs:line 63
at ColorPicker.PopupContainerImages.Image(eIndexes index) in c:\Temp\ColorDialogEx\ColorDialogEx\Resources\Images.cs:line 68
at ColorPicker.DropdownContainer`1.OnPaint(PaintEventArgs e) in c:\Temp\ColorDialogEx\ColorDialogEx\DropdownContainerControl.cs:line 335
at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region transparentRegion)
at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset)
at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
Do you think I need to do something else before I can use it?
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
Let me look at it again. I thought I fixed that.
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
Fixed it. Try downloading it again. Same link as before.
I forgot to modify one of the resource finder things.
Why the original author did not use the built in resource management and basically (and incorrectly) rebuilt it is beyond me.
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
Thank you, Mr. Speedy Zac. I will download it and try again.
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
PHS241 wrote: Mr. Speedy Zac.
That's a first. I usually am called 'Slow' by people because I like to think things through before trying them. It usually works out better that way.
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
Here is my code:
class dbLocalDB : DataManager
{
private System.Data.Common.DbConnectionStringBuilder BldrLocalDB = new System.Data.Common.DbConnectionStringBuilder();
public System.Data.Common.DbConnectionStringBuilder ConnectionString
{
get { return BldrLocalDB; }
set
{
BldrLocalDB.ConnectionString = XenoManager.Properties.Settings.Default.csLocalDB;
}
}
}
public partial class Form1 : Form
{
dbLocalDB LocalDB = new dbLocalDB();
public Form1()
{
InitializeComponent();
try
{
tb_LocalDBServerURL.Text = LocalDB.ConnectionString["Data Source"].ToString();
tb_LocalDBDatabase.Text = LocalDB.ConnectionString["Initial Catalog"].ToString();
tb_LocalDBUsername.Text = LocalDB.ConnectionString["User ID"].ToString();
tb_LocalDBPassword.Text = LocalDB.ConnectionString["Password"].ToString();
}
catch (Exception ex)
{
textBox1.Text = ex.ToString();
}
}
}
I get the following error "System.ArgumentException: Keyword not supported: 'Data Source'. at System.Data.Common.DbConnectionStringBuilder.get_Item(String keyword)"
I think what's happening is BldrLocalDB.ConnectionString isn't being populated. If I had:
System.Data.Common.DbConnectionStringBuilder bldrLocalDB = new System.Data.Common.DbConnectionStringBuilder();
bldrLocalDB.ConnectionString = Properties.Settings.Default.csLocalDB;
in "public partial class Form1 : Form", it'll populate, but how do I populate it in the dbLocalDB class?
Thanks!
|
|
|
|
|
Not every connectionstring provides a datasource[^]; what does the actual string look like?
|
|
|
|
|
Hi,
Ive got a Treeview with scrollable enabled. On my developing PC everything works fine. When i resize my window, the scrollbar appears.
But when I run the .exe on another PC (even when its installed by an setup installer), there are no scrollbars! I've tried on 3 different PCs. All PCs are using Windows 7 and the required .Net4 is installed. I dont know whats the problem. Everything else works . Please help.
Edit: Okay, the Problem appears when i use the treeview in a SplitContainer. Is this a know issue and is there a workaround? i really need those splitcontainers.
Edit: Got it! Each Element within a splitcontainer panel has to have the dock property set to "Fill". Now it works .
Any ideas?
Thanks
|
|
|
|
|
I've done that, although it took me about 6 months to notice than anything was wrong!
|
|
|
|
|
Hi there!
I am trying to compare the rows of a Datagridview and that it removes the rows that are repeated.
I think that I´m doing something wrong, need some of help!!
my mind is not clear today! (maybe x-mas holyday! )
here´s the code:
public void Compare(DataGridView grv)
{
grv.Sort(grv.Columns[0],ListSortDirection.Ascending);
for ( int row = 0; row < grv.Rows.Count; row++)
{
for ( int col = 0; col < grv.Columns.Count; col++)
{
int rowx=1;
if (grv.Rows[row].Cells[col].Value != null && grv.Rows[row].Cells[col].Value.Equals(grv.Rows[rowx].Cells[col].Value))
{
if (col == grv.Columns.Count - 1)
{
grv.Rows.RemoveAt(row);
grv.Sort(grv.Columns[0], ListSortDirection.Descending);
}
}
else
{
grv.FirstDisplayedScrollingRowIndex = grv.RowCount - 1;
grv.Rows[grv.RowCount - 1].Selected = true;
}
}
}
}
|
|
|
|
|
hi,
you forgot the a counter if all cols in a row are equal to the ones in rowx? in this case you would delete the row always if the last col is equal. Maybe thats it?
cu
|
|
|
|
|
Hi all,
Adding an optional field to my class instantly prevents older versions from being deserialized:
[OptionalField]
public Aurigma.GraphicsMill.Bitmap origStaticImage = null;
This is baffling; optional fields are supposed to PREVENT this! The [NonSerialized] attribute produces the same behavior. I have many other optional fields in this class that have been added over the years, and they work perfectly. If I remove the field, I can again deserialize older versions.
Any suggestions how to get around this? Thanks!
====================
Solved it; an exception was being thrown in my RunAfterDeserialization method, making it appear that deserialization had failed. Doh!
"Microsoft -- Adding unnecessary complexity to your work since 1987!"
modified 6-Dec-12 11:50am.
|
|
|
|
|
Hi thanks in advance,
I really need to know is how to expose a layer of memory data on data tables that can be updated from time to time and who are available for consultation in memory for faster access and query the database to each time.
|
|
|
|