|
He told you all you need to know, in C# it's square brackets, any error you get now, is because the code is wrong.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I have a datatable that contains 10 columns (Say they are called column1, column2, column3, etc).
I have a schema that contains column3 (meaning I only want to create an XML file containing this column).
How would I export only column3 from my datatable into an XML file based off a supplied schema file ?
Thanks
|
|
|
|
|
Dear all,
I've searched high and low to find an example of a way to preview and print a single panel. I found a few ( very expensive ) commercial libraries , but I don't want to go down that path. Is there anyone who could help me out , or at least point me in the right direction on how it's done.
Kind regards,
Rick
|
|
|
|
|
Hi,
isn't any of this hits[^] what you need?
Robert
|
|
|
|
|
This is how you build the printpreview functionality. whatever is in the printDocument1 object gets printed or previewed on the screen.
PrintPreviewDiag ppd = new PrintPreviewDialog();
ppd.Document =printDocument1;
ppd.ShowDialog();
|
|
|
|
|
How do you customize a label control so that I can change the border color? I have searched high and low for examples/samples for a "label" control but found absolutely nothing.
Should I create my own label control from scratch?
-- Thanks!
|
|
|
|
|
Override the OnPaint event, like so:
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class MyLabel : Label
{
private Color borderColor;
public MyLabel()
{
InitializeComponent();
borderColor = Color.Black;
}
public Color BorderColor
{
get { return borderColor; }
set { borderColor = value; }
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawRectangle(new Pen(borderColor),
new Rectangle(0, 0, Width - 1, Height - 1));
}
}
}
|
|
|
|
|
Thank you very much for getting back to me on this so quickly.
|
|
|
|
|
I tried this out and it works great. Thanks again.
|
|
|
|
|
hi everybody,
I don't really use treeviews at all, but I need to for my current prototype. ...What I really need is a nested treeview (treeview as a treenode) and I can't find any usage guidelines for adding a treeview to the treeview.Nodes collection....is it as simple as filling out an 'inner' treeview and adding it to 'outer' treeview's Nodes collection?
...or am I going to have to extend the TreeView?
btw...VS 2003, not 2005
(Nyquist_Rate || ! Nyquist_Rate)
{
Console.WriteLine("That is the question");
}//Go Colts
|
|
|
|
|
You can't directly add a treeview to another one. If you knew your 2nd treeview had only 1 root node then do something like:
treeView1.SelectedNode.Nodes.Add(treeView2.Nodes[0]);
If there are multiple top level nodes then do:
foreach (TreeNode node in treeView2.Nodes)
{
treeView1.SelectedNode.Nodes.Add(node);
}
|
|
|
|
|
ok..here's my problem. I'll provide code:
The indexer for which dataset to display in the treeview is controlled by the selected Index of a listview
if(lvwDisplay.SelectedIndices.Count > 0)
{
index = lvwDisplay.SelectedIndices[0];
UIAddress location = (UIAddress)myAddressList[index];
Now I create the structure in the treeview to allow the PointsOfInterest to be
deserialized from my collection
for(int asdf = 0; asdf < location.PointsOfInterest.Length; asdf++)
{
TreeView inner = new TreeView();
inner.Name = location.PointsOfInterest[asdf].Name;
inner.Nodes.Add(location.PointsOfInterest[asdf].Fee.ToString());
TreeView gps= new TreeView();
gps.Name="Geocode";
gps.Nodes.Add(location.PointsOfInterest[asdf].Center.X.ToString());
gps.Nodes.Add(location.PointsOfInterest[asdf].Center.Y.ToString());
.
.
.
PROBLEM: ...you'll see it
tvPOI.Nodes = new TreeNodeCollection[location.PointsOfInterest.Length];
tvPOI.SelectedNode = tvPOI.Nodes[asdf];
for(int i = 0; i<geocode.Nodes.Count;i++)
{
tvPOI.SelectedNode.Nodes.Add(geocode.Nodes[i]);
}
...tvPOI.SelectedNode is readonly. Anybody know how to implement the functionality I'm trying to add?
(Nyquist Rate || ! Nyquist Rate)
{
Console.WriteLine("That is the question");
}
|
|
|
|
|
SelectedNode has a get and a set so you can set it, but I think you're trying to select a node that hasn't been added to the Collection yet.
tvPOI.Nodes.Clear();
for (
{
tvPOI.Nodes.Add(
}
tvPOI.SelectedNode =
|
|
|
|
|
My error in my last post:
tvPOI.Nodes = new TreeNodeCollection[location.PointsOfInterest.Length];
tvPOI.SelectedNode = tvPOI.Nodes[asdf];
for(int i = 0; i
{
tvPOI.SelectedNode.Nodes.Add(geocode.Nodes[i]);
}
I shoulda said that tvPOI.Nodes is read only...not tvPOI.SelectedNodes
(Nyquist Rate || ! Nyquist Rate)
{
Console.WriteLine("That is the question");
}
|
|
|
|
|
ok...think I got it. I just changed
tvPOI.Nodes = new ...
to
tvPOI.Nodes.Add("sdalfkjglasdkfh");
and everything was kosher.
(Nyquist Rate || ! Nyquist Rate)
{
Console.WriteLine("That is the question");
}
|
|
|
|
|
Im using sql server 2005 and trying to connect to a remote database, but i get the error "SQL Server does not exist or access denied".
There is not problem with the code and it has worked many times on other projects and will connect to the database when run locally.
The database has also been setup to accept remote connections, but i still cannot get a connection.
Any ideas?
Thanks for any help.
|
|
|
|
|
|
Yes, just though i would build some suspence before i asked it.
|
|
|
|
|
ednrgc wrote: Is there a question?
Does "Any ideas?" not count?
|
|
|
|
|
When I posted my reply, there was absolutely nothing in the original post. Hence my asking if there was a question.
|
|
|
|
|
ednrgc wrote: When I posted my reply, there was absolutely nothing in the original post. Hence my asking if there was a question.
Ah... That makes sense. It also seems to be intermittent whether the post is marked as "Modified" or not. (Perhaps because the poster can remove that text if they wish)
|
|
|
|
|
Have you checked the firewall between the computers. It might be blocking the port.
|
|
|
|
|
Windows firewall is turned off and there is no other firewall in-between the boxes.
|
|
|
|
|
wheelerbarry wrote: Windows firewall is turned off and there is no other firewall in-between the boxes.
Has the server been configured to use a different port?
Can you get Enterprise Manager/ SQL Management studio / Query Analyzer to connect?
|
|
|
|
|
Can you connect with VS. If so you could verify the connection strings via vs.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|