 |
 |
Index ‹ DotNet ‹ Visual C#.Net
|
- Previous
- 1
- Dotnet >> System.Messaging namespace missing in VB.NET?After spending a little time reading the documentation, I attempted to add
some messaging code to my VB.Net project, only to discover that I couldn't
get past my
Imports System.Messaging
statment because the System.Messaging namespace is missing. Did I fat
finger it into oblivion without knowing it, or is this a known issue? Any
suggestions on how to fix this, in any case?
Any help appreciated...
- 2
- Winforms >> Acceptbutton does not work in usercontrols.If you have buttons on a form and you tab around when a button gets focus it
automatically gets highlighted. That is the forms AcceptButton changes to
the currently focused button. However when you have a usercontrol with a few
buttons in it and you tab around in there when the button gets focus it does
not automatically get highligthed. You can press Spacebar to activate but
that is not desired behaviour. Dont want to handle leave and enter events on
all buttons just because they are in a usercontrol to get them highlighted.
How can this be achieved?
Best Regards
//P
- 3
- Visual C#.Net >> Old database system question.For a possible update of an old system, I'm trying to work out how to
connect to a password protected Paradox database table. I've got a
connection string that works with the non-password protected files in the
same directory, but that one protected control file is critical.
Anybody know how to open up a passworded Paradox database file in C#?
Yes, I know the whole thing should be re-written using a better db, but I
don't expect the client to sign off on that this year.
- 4
- Visual C#.Net >> Getting location in a scrollable pictureboxHi,
I have a scrollable view which contains a picturebox.
I need to get the location of the top let hand corner of the view so I
can draw an icon.
When the picturebox is scrolled vertically I need the icon to remain in
the top left hand corner of the view.
At the moment whenever I scroll the picturebox down, the icon gets
hidden.
Thanks in advance.
private void pictureBox1_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
// Need to get the correct location otherwise the
rectangle will disappear when
// the picture is scrolled up
Rectangle boundingRect = new Rectangle(0, 0, 150, 50);
LinearGradientBrush myLinearGradientBrush = new LinearGradientBrush(
boundingRect,
Color.AliceBlue,
Color.Silver,
LinearGradientMode.ForwardDiagonal);
e.Graphics.FillRectangle(myLinearGradientBrush, boundingRect);
Rectangle rc = boundingRect;
rc.Inflate(-1,-1);
e.Graphics.DrawRectangle(new Pen(SystemColors.Highlight), rc);
}
- 5
- Visual C#.Net >> How to draw a rectangle on AxWebBrowser to high light one html element?Hi,
Now I can get the rectangle to draw, but it seems the rectangle is not
visible. The following code is used to draw the rectangle. Hope someone can
help. Thanks very much!
SolidBrush brush = new
System.Drawing.SolidBrush(System.Drawing.Color.Red);
Pen pen = new Pen(brush, 4);
Graphics formGraphics = Graphics.FromHwnd(this.axWebBrowser.Handle);
formGraphics.DrawRectangle(pen, rect);
- 6
- Visual C#.Net >> Drag and Drop into ListviewI am having problems with drag and drop into a listview. I am able to
drag and drop items from within the listview, as well as drag items
from the listview and drop into a picturebox. However, I am not able
to drag the text or image from the picturebox to the listview. In the
listview_dragenter function, I have e.Effects = DragDropEffects.Copy (I
have also tried e.Effects = DragDropEffects.Move, but it does not help
either), which is the same as what I have for the picturebox_dragenter
function. However, when I try to drag from the picturebox to the
listview, the cursor gives the same effect as DragDropEffects.None, and
the listview.DragDrop function never gets called. Does anyone have any
ideas of anything I am doing wrong? Thanks.
- 7
- 8
- Dotnet >> Parameter replacement wizard using code templates in Visual Studio 2005Hey all , I wanted to create a project or item template in C# such
that when I use that template a parameter wizard comes up asking for
values. I know how to create the template without implementing the
wizard, i.e., work the parameter replacement using the
<CustomParameters> keyword in XML.
So any hints or suggestions towards the procedure to having the
parameter replacement wizard (a GUI of some sort) would be greatly
appreciated,
cheers
- 9
- Visual C#.Net >> Order Text as NumbersHi,
I am currently writing a requirements gathering system which which
have requirement values of 1.1, 1.1.2, 1.1.3, 2.3.4.5 etc etc.
This works fine stored as varchar in SQL Server 2000 until I want to
sort it in a .Net datagrid. As soon as I reach 10, it obviously puts
the record down with the 1's and I am guessing 20 will go with the 2's
etc etc.
Can anyone suggest a way of getting round this - I know it is because
of the details being stored as text but I need some sort of solution.
Thanks
- 10
- ADO >> Dataadapter Add vs UpdateI have a generic question regarding ADO.net and how the CommandBuilder works.
I have a datagrid/dataset that is partially populated from pre exisiting records in a database table as well as NEW records/rows which are being added to the same dataset by a user via a simple textbox/form.
My question is, when the user is done adding new records and hits the final UPDATE button, does the dataadapter automatically know which records in my dataset are UPDATE preexisiting records as well as ADD new records (added manually by the user/form) or do I need to somehow programmatically , iterate through each row of the dataset, determine which rows are ADDS and which rows are UPDATES and then assign the appropriate SQL Sub Call (or if then) to each row in order to update the database table.
Thanks
devon
- 11
- Visual C#.Net >> Class design helpHi
I am looking at implementing a Facade architecture in my system. i.e
MyBusinessFacdeSystem and multiple MyBusinessObjects
I want the MyBusinssObject class to only be created by the
MyBusinessFacdeSystem class.
i.e
using System;
namespace FacadeTest.MyFacade
{
/// <summary>
/// Summary description for MyFacadeSystem.
/// </summary>
public class MyFacadeSystem
{
private MyBusinessObject_MyBusinessObject = null;
public MyFacadeSystem()
{
_MyBusinessObject= new MyBusinessObject();
}
public MyBusinessObjects MyBusinessObjectsBLL
{
get
{
return _MyBusinessObjects;
}
}
}
}
How do I set the accessability if the MyBusinessObject class i.e.:
using System;
namespace FacadeTest.MyFacade
{
/// <summary>
/// Summary description for MyBusinessObject .
/// </summary>
internal class MyBusinessObject
{
public MyBusinessObject ()
{
}
public string SomeMethod(){
return "Hello";
}
}
}
Hope that is clear,
S
- 12
- Visual C#.Net >> select a file in ExplorerHi,
As part of my Windows application, I need to open a folder
containing a file (fileName is specified in txtFile).
I have no problem opening the folder:
FileInfo info = new FileInfo(txtFile.Text);
string folderName = info.DirectoryName;
System.Diagnostics.ProcessStartInfo prStartInfo = new
System.Diagnostics.ProcessStartInfo;
prStartInfo.FileName = "explorer";
prStartInfo.UseShellExecute = true;
prStartInfo.WindowStyle = ProcessWindowStyle.Normal;
prStartInfo.Arguments = '"' + folderName + '"';
System.Diagnostics.Process.Start(prStartInfo);
But how do I select the file within the opened directory?
Any help is much appreciated.
- 13
- Dotnet >> custom logging sink for logging application blockI have written a custom logging sink for the enterprise library logging
application block (June 2005). I have been able to configure it as expected
from the UI config tool (EntLibConfig.exe).
I have built a console application to test it with and I am getting the
following error message write to the default trace log when I attempt to use
my custom logging sink.
'An error occurred while the Distributor was processing the message. Please
check your configuration files for errors or typos. Verify that your sinks
are reachable (queues exist, permissions are set, database exists, etc...)'
This might be security related can anyone give me the answer on how to fix
this?
I can see from VS that the module for my custom logging sink is loaded at
runtime but I am unable to break into the assembly which indicates to me
that any of the 'LogSink' overridden methods are not being called.
Cheers
Ollie Riches
- 14
- Microsoft Project >> Export to Excel weirdnessProject Server 2003...
When I am on the Project Web Access page, and do Resources --> View Resource
Assignments -->Export Grid to Excel, I get different data in the Excel
spreadsheet than what is showing in the grid on the web page.
1) Tasks that have been deleted from projects are showing in Excel
2) Tasks where the rsource assignments have been changed are showing both
the new and the old asssignments (old assignments can't be found anywhere
else and we don't want them)
How can I fix this?
Thanks!
--
Jim
- 15
- Net Framework >> DataGrid / FlexGrid - Expand/Collapse rowsHi everyone,
Can anyone advice me of a way to emulate the Tree Control by the use of
DataGrid for Web forms?
What I would ideally like to do is to have Summary rows with details rows
hidden until such time that the user clicks a particular Summary row.
Clicking it again will hide the details rows (collapse).
I thought of dynamically adding rows to the DataGrid by querying the
database using the selected row's ID but it seems this option will chew up
lots of resources.
Any suggestions are gladly welcomed.
|
| Author |
Message |
Bruincdc

|
Posted: Tue Dec 14 02:09:17 CST 2004 |
Top |
Visual C#.Net >> 0.00007m -> 7E-5 ?
Hello.
I'd want to see the right value that inserted, but very small value like
0.00007m doesn't displayed exactly(displayed 7E-5).
ex)
decimal b = 0.00007m;
TextBox.Text = b.ToString(); => 7E-5
TextBox.Text = b.ToString("F"); => 0.00
TextBox.Text = b.ToString("0.00000"); => 0.00007 (but 0.00000007 not
supported)
TextBox.Text = b.ToString("0.0000000000"); => 0.0000700000
so, I want to know the string format type that all decimal values show the
values as it is.
decimal b = 0.00007m; ( for all decimal cases like 0.0000007m,
0.0000000000007m )
TextBox.Text = b.ToString(????); => 0.00007
Please, help me~ ^^
ps. maybe understanding this question is harder than solving..^^ sorry and
thanks..
DotNet356
|
| |
|
| |
 |
Lowell

|
Posted: Tue Dec 14 02:09:17 CST 2004 |
Top |
Visual C#.Net >> 0.00007m -> 7E-5 ?
Where are you putting the data to be shown at ? I compiled this code and
it showed up exactly perfect, the way it should:
decimal d = 0.00007m;
string test = d.ToString();
MessageBox.Show(test);
I got a response of a messagebox showing 0.00007
The problem could be perhaps that whatever you are showing the data in
cannot support a number that big(or small)?
Lowell
antonio. kim wrote:
> Hello.
> I'd want to see the right value that inserted, but very small value like
> 0.00007m doesn't displayed exactly(displayed 7E-5).
>
> ex)
> decimal b = 0.00007m;
>
> TextBox.Text = b.ToString(); => 7E-5
> TextBox.Text = b.ToString("F"); => 0.00
> TextBox.Text = b.ToString("0.00000"); => 0.00007 (but 0.00000007 not
> supported)
> TextBox.Text = b.ToString("0.0000000000"); => 0.0000700000
>
> so, I want to know the string format type that all decimal values show the
> values as it is.
>
> decimal b = 0.00007m; ( for all decimal cases like 0.0000007m,
> 0.0000000000007m )
> TextBox.Text = b.ToString(????); => 0.00007
>
> Please, help me~ ^^
>
> ps. maybe understanding this question is harder than solving..^^ sorry and
> thanks..
|
| |
|
| |
 |
Antoniokim

|
Posted: Tue Dec 14 02:27:02 CST 2004 |
Top |
Visual C#.Net >> 0.00007m -> 7E-5 ?
Thank you for answering..
but I use the same code that you suggest, I got 7E-5...
maybe other configulation is different between our machines..
is there anybody knows this?
"Lowell Heddings" wrote:
> Where are you putting the data to be shown at ? I compiled this code and
> it showed up exactly perfect, the way it should:
>
> decimal d = 0.00007m;
> string test = d.ToString();
> MessageBox.Show(test);
>
> I got a response of a messagebox showing 0.00007
>
> The problem could be perhaps that whatever you are showing the data in
> cannot support a number that big(or small)?
>
> Lowell
>
>
>
> antonio. kim wrote:
> > Hello.
> > I'd want to see the right value that inserted, but very small value like
> > 0.00007m doesn't displayed exactly(displayed 7E-5).
> >
> > ex)
> > decimal b = 0.00007m;
> >
> > TextBox.Text = b.ToString(); => 7E-5
> > TextBox.Text = b.ToString("F"); => 0.00
> > TextBox.Text = b.ToString("0.00000"); => 0.00007 (but 0.00000007 not
> > supported)
> > TextBox.Text = b.ToString("0.0000000000"); => 0.0000700000
> >
> > so, I want to know the string format type that all decimal values show the
> > values as it is.
> >
> > decimal b = 0.00007m; ( for all decimal cases like 0.0000007m,
> > 0.0000000000007m )
> > TextBox.Text = b.ToString(????); => 0.00007
> >
> > Please, help me~ ^^
> >
> > ps. maybe understanding this question is harder than solving..^^ sorry and
> > thanks..
>
|
| |
|
| |
 |
Morten

|
Posted: Tue Dec 14 04:03:45 CST 2004 |
Top |
Visual C#.Net >> 0.00007m -> 7E-5 ?
Odd,
As far as I know the only configuration differences are in currency
formats and the use of , or . as decimal point.
Regular output for me is always 0,00007 (, is the decimal point) and
scientific format ("E") is output as 7,000000E-005 not 7E-5.
You might try the General specifier ("G") which outputs the number in the
shortest of fixed or scientific. This always gave me 0,00007.
Btw, "0.0000" == "F5", easier to write :)
On Tue, 14 Dec 2004 00:27:02 -0800, Antonio. kim
<EMail@HideDomain.com> wrote:
> Thank you for answering..
> but I use the same code that you suggest, I got 7E-5...
> maybe other configulation is different between our machines..
> is there anybody knows this?
>
> "Lowell Heddings" wrote:
>
>> Where are you putting the data to be shown at ? I compiled this code and
>> it showed up exactly perfect, the way it should:
>>
>> decimal d = 0.00007m;
>> string test = d.ToString();
>> MessageBox.Show(test);
>>
>> I got a response of a messagebox showing 0.00007
>>
>> The problem could be perhaps that whatever you are showing the data in
>> cannot support a number that big(or small)?
>>
>> Lowell
>>
>>
>>
>> antonio. kim wrote:
>> > Hello.
>> > I'd want to see the right value that inserted, but very small value
>> like
>> > 0.00007m doesn't displayed exactly(displayed 7E-5).
>> >
>> > ex)
>> > decimal b = 0.00007m;
>> >
>> > TextBox.Text = b.ToString(); => 7E-5
>> > TextBox.Text = b.ToString("F"); => 0.00
>> > TextBox.Text = b.ToString("0.00000"); => 0.00007 (but 0.00000007 not
>> > supported)
>> > TextBox.Text = b.ToString("0.0000000000"); => 0.0000700000
>> >
>> > so, I want to know the string format type that all decimal values
>> show the
>> > values as it is.
>> >
>> > decimal b = 0.00007m; ( for all decimal cases like 0.0000007m,
>> > 0.0000000000007m )
>> > TextBox.Text = b.ToString(????); => 0.00007
>> >
>> > Please, help me~ ^^
>> >
>> > ps. maybe understanding this question is harder than solving..^^
>> sorry and
>> > thanks..
>>
--
Happy Coding!
Morten Wennevik [C# MVP]
|
| |
|
| |
 |
Stefan

|
Posted: Fri Dec 17 04:06:41 CST 2004 |
Top |
Visual C#.Net >> 0.00007m -> 7E-5 ?
Doubles seem to use the scientific format you mentioned. Are you sure you're
using decimal?
For me, it's:
0.00007.ToString() => 7E-5
0.00007m.ToString() => 0,00007
even
0.0000000000000000000000000007m.ToString()
yields
0,0000000000000000000000000007
HTH,
Stefan
"Morten Wennevik" <EMail@HideDomain.com> wrote in message
news:opsizswjb8klbvpo@pbn_computer...
> Odd,
>
> As far as I know the only configuration differences are in currency
> formats and the use of , or . as decimal point.
>
> Regular output for me is always 0,00007 (, is the decimal point) and
> scientific format ("E") is output as 7,000000E-005 not 7E-5.
>
> You might try the General specifier ("G") which outputs the number in the
> shortest of fixed or scientific. This always gave me 0,00007.
>
> Btw, "0.0000" == "F5", easier to write :)
>
> On Tue, 14 Dec 2004 00:27:02 -0800, Antonio. kim
> <EMail@HideDomain.com> wrote:
>
>> Thank you for answering..
>> but I use the same code that you suggest, I got 7E-5...
>> maybe other configulation is different between our machines..
>> is there anybody knows this?
>>
>> "Lowell Heddings" wrote:
>>
>>> Where are you putting the data to be shown at ? I compiled this code and
>>> it showed up exactly perfect, the way it should:
>>>
>>> decimal d = 0.00007m;
>>> string test = d.ToString();
>>> MessageBox.Show(test);
>>>
>>> I got a response of a messagebox showing 0.00007
>>>
>>> The problem could be perhaps that whatever you are showing the data in
>>> cannot support a number that big(or small)?
>>>
>>> Lowell
>>>
>>>
>>>
>>> antonio. kim wrote:
>>> > Hello.
>>> > I'd want to see the right value that inserted, but very small value
>>> like
>>> > 0.00007m doesn't displayed exactly(displayed 7E-5).
>>> >
>>> > ex)
>>> > decimal b = 0.00007m;
>>> > TextBox.Text = b.ToString(); => 7E-5
>>> > TextBox.Text = b.ToString("F"); => 0.00
>>> > TextBox.Text = b.ToString("0.00000"); => 0.00007 (but 0.00000007 not
>>> > supported)
>>> > TextBox.Text = b.ToString("0.0000000000"); => 0.0000700000
>>> >
>>> > so, I want to know the string format type that all decimal values
>>> show the
>>> > values as it is.
>>> >
>>> > decimal b = 0.00007m; ( for all decimal cases like 0.0000007m,
>>> > 0.0000000000007m )
>>> > TextBox.Text = b.ToString(????); => 0.00007
>>> >
>>> > Please, help me~ ^^
>>> >
>>> > ps. maybe understanding this question is harder than solving..^^
>>> sorry and
>>> > thanks..
>>>
>
>
>
> --
> Happy Coding!
> Morten Wennevik [C# MVP]
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Visual C#.Net |
- Next
- 1
- Visual C#.Net >> Parsing using RE?Hello all
I have a huge string that I need to parse
Key <Delim1> Value <Delim2> Key <Delim1> Value <Delim2> Key <Delim1>
Value <Delim3>
Key <Delim1> Value <Delim2> Key <Delim1> Value <Delim2> Key <Delim1>
Value <Delim3>
repeat for a couple hundred thousand times
The <Delim1> seprates the Key, Value pair
<Delim2> seprates two different Key,Value pairs
<Delim2> seprates records.
I need to get the Key Value pairs and populate a table with that
information.
Would the .NET regular expressions be worth while and how would I go
about doing it in a clean optimized fashion.
Thanks
-Ravi Singh
- 2
- ADO >> Create DataTable From Existing DataTablei created a SataSet that contain several DataTables,
i need to create some more DataTables and DataVies,
the problem is that each of them should contain another
DataColumns, i eant to select the columns from the
existing tables not only the rows.
sample:
one of the datatables in the dataset contain those
DataColumns: firstName, lastName, address,phone,fax and
mobile,
i want to create DataView that carry all the rows that the
last name begin with 'A' , but the columns needed are only
the last name and first name.
- 3
- 4
- ADO >> I don't understand pooling :-SOK, I understand what it's supposed to do, but I don't understand what it is
actually doing. Actually, I don't understand the .Net CLR Data values
numbers reported by Performance Monitor.
I wrote a very simple app that allows me to specifically open and close a
sql connection. When I open the connection, I see the Current # connection
pools increase by one and the Current # pooled connections increase by 2.
This is consistant with my understanding of what the pooling is supposed to
do. I can open and close the connection as many times as I like and the
numbers don't change.
When I close the app, the numbers in performance monitor remain the same. I
was expecting them to go away.
Then I run the app again. I open the connection and the previously mentioned
values increase again! Basically, it's like a whole new pool is created
again. What is going on? Is Performance Monitor misreporting or is the
pooling not working properly. Reading some of the messages here about this
subject, it appears that the latter would be true.
Even after I close VS, Performace Monitor continues to report the same
values. They don't go away.
--
Willy Esteban
- 5
- Visual C#.Net >> Which controls can wrap lineI am using VS2005 to develp Win form program.
I add lines to a ListBox.
But when the line width larger than the width of the ListBox, the ListBox
can't wrap the word.
What conrols is suittable for me to add lines and can wrap words?
- 6
- Visual C#.Net >> Keyboard Hook, HotkeysSo I have a keyboard hook that I have implemeted into my c# app. I need to
not allow any hotkey actions to be performed when my app is opened. I can
capture the key events and handle them if I want to. The only problem is
that I have fields that require input. Do I have to programmatically add the
characters to the input fields when I am handling the event. I don't want
these keys sent to the system. But only to my program.
Or does someone else have an idea on how to get all the hotkeys, unregister
them, then re-register them when the application exits?
I would think there would be some low level call that would allow this.
- 7
- Microsoft Project >> Working with values in Customized fieldsIn a custom text field, I have specified values. The field has worked fine
for 6 months or longer. This week, I have modified the values in the field.
And, when I save the project file and return later, the changes have not been
saved. Does anyone have any information that will help me understand why
this custom field data is not recording. Also, I have set the check-box so
the values are not limited to the value list. I left several cells blank (on
purpose) and after I returned to the file later, those "blank" cells had data
posted. This is very frustrating. At this point, I am ready to create a new
custom text field and start all over, but I have 25 plans that are affected
by the new field values. If you have any suggestions, please write!
- 8
- Microsoft Project >> Task, resource calendarsHi all,
I am very new to MSP 2007 and still learning it day by day.
A have a very first question about the calendars when I plan some pilot
projects.
I have created a new calendar called "Non-Friday" where we work only from
Sunday to Thursday (Friday and Saturday are non-working). I have set the
project calendar to "Non-Friday". The timescale non-working calendar also has
been set to "Non-Friday". The task calendar is also "Non-Friday".
However, when I increase a task duration (scheduled for one day on Thursday)
to 2 days, the Gantt chart shows this task also works on Friday (from
Thursday to Friday). The task type I set is Fixed Units.
Where is the step I am missing? How to schedule the task so that it will not
work on non-working days?
Thanks for any help.
I will probably have more questions when I go along the learning process and
I appreciate all your answers.
Best regards,
Sondin
- 9
- Visual C#.Net >> Select Users or Groups FormHi,
I have one Listbox and Two buttons one is Add and Other is Remove.
When i click the add button i want to show the Select Users or Groups
Form(i.e, When you right click any file or folder and click Properties
and then Go to Seurity Tab and Click Add Button. Now it will show the
Select Users or Groups Form.After selecting the user when you click ok.
The user will be added to the Listbox).
Now my requirment is i have custom listbox and Add and Remove
Buttons and i need when user click the Add button i want to show the
Select Users or Groups Form(system form). Then when they select any
user that user have to be added in my Custom list box.
How can i do this? If anybody knows the solution please let me know to
solve it?
Thanks,
Vinoth
- 10
- ADO >> Data View Thread Safety ProblemI have a multi-threaded application with a static constructor and static
DataSet and DataView variables, populated in the constructor.
i then create many threads to access the static DataView but some of the
threads generate errors while others work. Here is the code for the sample
console app
using System;
using System.Data;
using System.Threading;
namespace DataViewTest
{
class DataViewTest
{
static DataSet _ds;
static DataView _dv;
private volatile Thread _thread;
private string _name;
static DataViewTest()
{
_ds = new DataSet();
DataTable tableOne = new DataTable("TableOne");
tableOne.Columns.Add(new DataColumn("Force", typeof (int)));
tableOne.Columns.Add(new DataColumn("Section", typeof (string)));
tableOne.Columns.Add(new DataColumn("ApplicationID", typeof (string)));
tableOne.Columns.Add(new DataColumn("GroupID", typeof (int)));
tableOne.Columns.Add(new DataColumn("Name", typeof (string)));
DataRow newRow = tableOne.NewRow();
newRow["Force"] = 13;
newRow["Section"] = "0";
newRow["ApplicationID"] = "FA";
newRow["GroupID"] = 1;
newRow["Name"] = "ZZ";
tableOne.Rows.Add(newRow);
_dv = new DataView(tableOne, null, "GroupID", DataViewRowState.CurrentRows);
_ds.Tables.Add(tableOne);
_ds.AcceptChanges();
}
public DataViewTest(string threadName)
{
_name = threadName;
}
internal void Run()
{
if(_dv[0]==null)
{
System.Diagnostics.Trace.WriteLine(string.Format("{0} FAILED", _name));
}
else
System.Diagnostics.Trace.WriteLine(string.Format("{0} worked", _name));
}
internal void Start()
{
_thread = new Thread(new ThreadStart(Run));
_thread.Name = _name;
_thread.IsBackground = true;
_thread.Start();
}
}
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
private static DataViewTest[] _workers;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
_workers = new DataViewTest[100];
for (int ct=0; ct<_workers.Length; ct++)
{
_workers[ct] = new DataViewTest(string.Format("Thread '{0}'", ct));
}
for (int ct=0; ct<_workers.Length; ct++)
{
_workers[ct].Start();
}
while(true)
Thread.Sleep(1000);
}
}
}
here is some sample output
Thread '0' worked
The thread 'Thread '0'' (0x1dd4) has exited with code 0 (0x0).
Thread '27' worked
The thread 'Thread '27'' (0x1f18) has exited with code 0 (0x0).
Thread '63' worked
Thread '6' worked
Thread '1' FAILED
The thread 'Thread '6'' (0x1e70) has exited with code 0 (0x0).
The thread 'Thread '1'' (0x1b08) has exited with code 0 (0x0).
Thread '3' FAILED
The thread 'Thread '3'' (0x14d8) has exited with code 0 (0x0).
Thread '11' worked
Thread '2' FAILED
The thread 'Thread '11'' (0x1d90) has exited with code 0 (0x0).
The thread 'Thread '2'' (0x1bd8) has exited with code 0 (0x0).
Thread '5' worked
The documentation says that DataViews are threadsafe, so why is this
happening? Sometimes, everything is OK, but more often than not, at least one
thread fails.
- 11
- Microsoft Project >> mail mergeAlthough I am quite fluent in using Ms word I cant get my head around mail merge,
crewating an address list and print envelopes etc from that list. Please can anyone help thanks.
- 12
- ADO >> DDE command with sqlComman objectHi,
i try to execute a DDE command with an SQlClientSQLCommen object and i
obtain "syntax error near "Then" ":
dim sql as string
sql = "CREATE TRIGGER myTrigger " & _
"ON MyTable " & _
"AFTER(UPDATE) " & _
"AS " & _
"BEGIN " & _
"SET NOCOUNT ON; " & _
"If UPDATE(Myfield) Then " & _
"BEGIN " & _
"UPDATE MyTable SET MyOtherField=1 WHERE myID IN (SELECT myID from INSERTED)
" & _
"END " & _
"END"
dim oCmd as new sqlClient.SqlCommand(sql,MyConnection)
oCmd.CommandText = sql
oCmd.ExecuteNonQuery()
So, is my syntax incorrect ? (this request works well in a query analyzer)
Best regards,
--
Sebho
- 13
- Dotnet >> How Do I INsert Numbers Into a Raffle Ticket TemplateI have downloaded a template to create raffle tickets and I want to avoid
having to manually type in the ticket numbers. Can I input the numbers into
an Excel spreadsheet and then merge with the Word document? Or can I
actually input a formula in Word to assign ticket numbers?
- 14
- ADO >> Regenerate datasetsHow do other "regenerate a dataset" and when that term is used, what does it
mean? Telling the designer to "generate" a dataset results in a NEW file,
which you then have to jerk around to fit into the old structure. An easier
way seems to be just to go into the designer and make changes. Example, I'm
making changes to the underlying database. So I go into the .xsd and delete
the old table structure and add the new table structure (and relations). Is
there any other way?
- 15
- Visual C#.Net >> Garbage CollectionHello:
We are considering developing a time critical system in C#. Our tool used in
Semiconductor production and we need to be able to take meaurements at
precise 10.0 ms intervals( 1000 measurement exactly 10 ms apart. In the
future this may decrease to 5ms ). I am concerned that if garbage
collection invokes during this time it may interfere with our measurement
results. I have looked over the garbage collection mechanism and see no way
to control when garbage collection occurs. Is there a way to pause and
start garbage collection? or some other technique that I can use to prevent
garbage collection while I am taking measurements?
Thanks
Bob
|
|
|