|
|
That could easily throw an OverflowException if your integer value was greater than 254. To convert any numeric type, use BitConverter.GetBytes instead, which will return an array of bytes if you expect values greater than 254.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I hope i don't get slammed to hard for this question but i can't seem to figure it out.
I understand you can use ///<summary> ///</summary> to do your comment pages
I also understand you can comment code with /* */ and //
So, how exactly do you add it to your function. For example.
If you have OleDbDataAdapter1.Fill(dataset); you can put the mouse over the Fill and it will say what it does like Fills dataset or whatever.
I noticed all the microsoft functions have this.
I would like to include this into my class i'm making so I could easily assist the user in using my class. I don't even know whats it is called i would assume a tooltip.
Thanks for the help.
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
You can try this:
1. Enter a path for the .xml documentation file in the project's properties
2. Copy that .xml with the .dll
I'm not sure if it works, but the .xml documentation contains all the summaries...
|
|
|
|
|
the xml file must also have the same name as the dll + ".xml"
eg:
mydll.dll
mydll.dll.xml
//Roger
|
|
|
|
|
Those styles of comments get compiled to an XML file which, as the others replies stated, needs to get deployed with your assembly in the same directory. That's what provides IntelliSense with member documentation.
For more on recommended tags and how to use them, see Documentation Comments[^]. Also, in your project configuration (right-click on the project, and select Properties) set the Documentation property to an XML file which matches your assembly name, like MyAssembly.xml if your assembly was MyAssembly.dll). This automatically builds the documentation XML file in the target directory (bin\Debug or bin\Release, by default depending on your build configuration).
You can also use these files to generate class documentation that can be easily viewed by developers, even integrated with the Visual Studio Common Collection which you see in VS.NET. See the NDoc[^] project - something I've helped develop a little - for a good (even Microsoft uses it for some projects) documentation generator that can produce HTML Help 1 and 2 and several other formats.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a database application i wrote to allow me to take notes on c# and enable me to look up the answers at a later time. If anyone is interested in this just shoot me an email and i'll happily send you the application. All i would ask in return is suggestions. In any event, in this application I use crystal reports to display my code snippets and so forth. This is where my question comes in. Once it generates the report for me it appears to be in read only which is perfectly fine however, is there a way to make it where i can copy and paste. This would be benificial to me instead of having to write the source code on line at a time. I know I could make a text box and overlay it so I basically select from the textbox and it appears to be from the report. To me that would be a crappy way of doing it. Any other ideas?
by the way if your interested in that program I mentioned send an email to
REMOVEME_bigt1@comcast.net
thats a one instead of a L
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
Reports and read-only for a reason - there's nothing to change. If you're looking for design capabilities at runtime, you need to license (costs mucho $$$) the designer components from Crystal Reports.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have been trying to add data coming from UdpClient onto a datagrid by populating the data into a table and then add it to a DataSet. However, when I bind the data to the DataGrid using DataGrid.SetDataBinding(), I got an error that says "The controls on one thread can not be parented to another control on a different thread". I have searched everywhere for a solution to get around this but haven't found one that would work.
Right now I am using ListView instead but I still like to use DataGrid.
Any of your help is greatly appreciated!
Thanks
|
|
|
|
|
I think you need to use a delegate and an event handler from your UDP code to solve your problem. I don't know if your UDP client generates any events but if not you could always use a timer. You may be checking the UDPclient via a timer anyway.
updateTimer = new System.Timers.Timer();
updateTimer.Elapsed +=new ElapsedEventHandler(UDP_ready);
updateTimer.Interval = 1000;
updateTimer.Start();
and then
public void UDP_ready(Object source, ElapsedEventArgs e)
{
BeginInvoke(new UDPHandler(UDPReadyHandler));
}
public delegate void UDPHandler();
public void UDPReadyHandler()
{
}
There may be a more efficient way of acheiving this but it worked for me in a similar situation. I think you can use variables with the delegate if you need to.
|
|
|
|
|
Thanks again Chris for your suggestion.
I think your solution applies to asynchronous event but for network stream data keep coming in constantly all the time, this method would not work. I tried the test again using a delegate but it still is giving the same whining.
Here is the outline of my code:
DataTable myTable;
DataSet mySet;
FillTableHeaders();
mySet.Tables.Add(myTable);
Thread theadTest = new Thread(new ThreadStart(GetData));
threadTest.Start();
void GetData()
{ FillTableThruUDPConnection();
dataGrid1.SetDataBinding(mySet,"ParentTable");
}
I think there is another internal thread when the datagrid binds the data from a table that I can't seem to find a way or a method that go around the SetDataBinding method. ListView works really well for because it doesn't have have to have another medium to hold the data like the DataTable.
|
|
|
|
|
Hi,
I would like to create a monitor for a server running as an NT Service. The monitor will be visible in the notification area and a context menu will enable starting, stopping restrting (etc.) the server.
I have no idea where to start from . Can you please provide me some reference or general oerview? is it possible at all? I searched the net for IIS monitor, which I know exists but I'm not sure whether only in my organization (perhaps someone there wrote it). Anyway, I couldn't find anything useful.
I didn't write the server so I don't know if it exposes some API. Any reference will be a great kick start.
Thanks.
-------------------------------------------------------------------
* Only drug dealers and computer programmers call their clients 'users'...
* Pardon me for the poor English.
|
|
|
|
|
Extend ServiceBase and create your service if you haven't already. Add an Installer derivative that uses the ServiceInstaller and ServiceProcessInstaller (both optionally if you choose to have another installer do it) that installs it.
When you install the service, you must have it log in as a specific user that has an associated desktop as well as "Log in locally" rights, or install it to run under LocalSystem (SYSTEM) and enabled desktop integration.
Your monitor then can use the ServiceController to communicate with it on a basic level and receive notifications from the service, or you could use named pipes (no support in the .NET FCL), sockets, .NET Remoting (optimal between AppDomains), etc.
Search CodeProject. I'd bet there's a couple examples of something similar, otherwise I'm sure you'll find examples if you google[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you Thank you Thank you ServiceController was the missing keywrod in my searches.
Still left to figure out is how to add the monitor to the notification area and add to it a context menu. I'll search and come back with questions
Bless you
-------------------------------------------------------------------
* Only drug dealers and computer programmers call their clients 'users'...
* Pardon me for the poor English.
|
|
|
|
|
See the documentation for the NotifyIcon component in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Lots of thanks
-------------------------------------------------------------------
* Only drug dealers and computer programmers call their clients 'users'...
* Pardon me for the poor English.
|
|
|
|
|
The last line of code below crashes my program. I am stumped as to why it's happening.
I've double and triple checked the definitions for the BlockCopy and GetBytes functions and I still can't work out what I'm doing wrong. Any insight would be appreciated.
namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int int1 = 3;
int int2 = 1000;
byte[] b = new byte[16];
Buffer.BlockCopy(BitConverter.GetBytes(int1), 0, b, 0, 8);
Buffer.BlockCopy(BitConverter.GetBytes(int2), 0, b, 12, 4);
}
}
}
NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
|
|
|
|
|
Try the following:
using System;
namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int int1 = 3;
int int2 = 1000;
byte[] b = new byte[16];
byte[] b2 = BitConverter.GetBytes(int1);
byte[] b3 = BitConverter.GetBytes(int2);
Buffer.BlockCopy(b2, 0, b, 0, b2.Length);
Buffer.BlockCopy(b3, 0, b, 12, 4);
}
}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
It's a weird problem, eh? The length of both arrays returned from GetBytes() is 4, so I think that it's actually the second-to-last line that's causing the problem with its length of 8. That code must be badly written in the current version of .NET: the second-to-last line above leaves the static stuff in Buffer somehow in an incorrect state, which is exposed by the subsequent call. Sorry I can't be of more help.
Regards,
Jeff Varszegi
|
|
|
|
|
Hi, I'm thinking of writing an extension to the asp.net Datagrid component (as web custom component), mainly to make the tasks that require repetitive coding like updating,insert, delete, easier, but also to add additional functionality.
First of all I was wondering if anyone knows of any open source or free components that already do this? Obviously I don't want to do something that's already been done - the list of goals for the first version are below.
If none is available, would anyone would be interested in helping in the project? The 5 goals I have in mind for the first version are:
- Obviously subclassed from the Datagrid
- IDE wizard for the SQL generation of update,delete,insert (similar to the sqladapater one)
- Automatically adds the insert textboxes in the header/footer, if set in a property
- Automatic handling of edit/delete/insert sql
- Delete confirm message (3 lines of code
- Property to automatically turn edit/delete/add on or off depending on the Context user being authed (also 3 lines of code
Future ideas I have in mind would be to have easy integration of other controls for the edit/insert, besides the standard textboxes, and a few other things.
- Chris
-- www.sloppycode.net --
|
|
|
|
|
You can always check places like http://www.asp.net[^] for existing controls.
One thing you should consider if you develop this yourself is not to re-develop the DataGrid itself, but to encapsulate that in another ASP.NET WebControl . There's a lot of work involved if you re-develop it, which is - as you implied - pointless many times. To have the DataGrid render itself, in your Render override simply pass the HtmlTextWriter to DataGrid.RenderControl (inheritted from WebControl ).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
No, my intention was firmly to subclass the Datagrid I've had a browse through sourceforge,asp.net and gotdot.net but couldn't find much. I'm also surprised that there are virtually no freeware/opensource .net forums out there besides the www.gotdotnet.com one. Perhaps the Microsoft community are unscrupulous (sp?) when it comes to people paying for their time.
|
|
|
|
|
There's plenty of free source here on CodeProject and many other places. The definition of "open source" is a very lax one.
Personally, I like to give back to the community by offerring bait, lures, and tackles so that others may learn to fish. I can't think of a single reason to spend my time (and perhaps others') on a commercial grade solution without getting something in return besides a few "thanks" and lots of support requests. People have to eat and shelter themselves. That's just my $0.02 (US) on open source vs. commercial software.
As far as extending the DataGrid , you could do that but you seem to be developing more of a composite control, which it's typically better to encapsulate (in order to control, for one). It'll also make rendering (including placement, etc.) a little easier.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
You can set the IsBackground property of all threads true.
Once all foreground threads belonging to a process have terminated, the common language runtime ends the process by invoking Abort on any background threads that are still alive.
Otherwise use the ApplicationExit event of Application class and abort the threads yourself inside the event handler.
|
|
|
|