|
Are you saying that you dont want to define t3 but you still want to display the information that you would have put in t3 in your datagrid?
Any particular reason why you don't want to define a table variable?
Kev
|
|
|
|
|
hi
my supervisor want me to do that , just for security matters
can u help me ?
he told me that i can declare a DataSet in the addRC() function , and retrive this DataSet from the button1_Click() ..
any thing to help me with ??
|
|
|
|
|
What addRC() function??
If you use a dataset then to the best of my knowledge you still need to use a datatable but you don't have to declare tehm first because the DataSet calss has a tables collection.
DataSet.Tables.Add()
You can add a new table to your dataset using the above code
once you have added the table to the dataset you can refer to it by
DataSet.Tables[0];
Then you can set up your table programaticaly and your away.
Hope this solves your problem
Kev
|
|
|
|
|
Help please,
I got some .dll written in Clarion 5.5. Can I (and how!) call it from my c# application.
Boris
|
|
|
|
|
How to convert string or StringBuilder to System.IO.Stream using C# ?
pls guide
|
|
|
|
|
|
If you haven't the option to use StringWriter, use MemoryStream and Convert.GetBytes
|
|
|
|
|
a WinForm as cool as windows media player and real player using C#?
like their button,like their skin?
thanks!
|
|
|
|
|
how can i make y orientation to up in c# coordinate system ,such as in vc++ ,use SetMapMode(MM_HIMETRIC) functon .
|
|
|
|
|
I have developed an installer for an application that utilizes the cygwin gcc compiler. I have to bundle the gcc together with the application. I have copied the structure of the cygwin gcc directories as it is. There a few shortcuts in the gcc directory structure that point to some directories and files residing inside the gcc directory structure. I also corrected the shorcut targets using orca after making the release msi. The problem is that the compiler doesn't seem to find the files and directories reffered by the shortcuts. If i replace the gcc folder created by the installer with the original gcc directory all works well.
I have made sure that the directory structure is copied as is and double checked it as well.
Kindly help me out of this problem.
|
|
|
|
|
I am trying to figure out the best way to convert a HTML page to an image. I need to be able to do this without actually displaying the URL in the browser and need to capture the entire horizontal and vertical size.
I have see some commercial products that appear to be using the IE control to perform this functionality but I cannot find anything on the web that discusses how this is done.
Does anyone have any ideas about how this can be accomplished?
|
|
|
|
|
Take a screen shot.
/\ |_ E X E GG
|
|
|
|
|
Unfortunately, it is not that simple. I need to be able to capture the entire rendered page regardless of the size - not just what is displayed in a browser window. Additionally, I want to do this entirely in code with no UI. I believe most of the ActiveX controls and other utilities out there are using a hidden IE control but I have not been able to get past the "visible" window problem.
|
|
|
|
|
This has been really puzzling me.
I have a windows services, written in c#.
What I'm trying to do now is to force single-threaded apartment.
So here's how my code look like:-
//Main Entry for Process
static void Main()
{
Thread.CurrentThread.ApartmentState = System.Threading.ApartmentState.STA;
}
When services starts, it will call this:-
protected override void OnStart(string[] args)
{
if (Thread.CurrentThread.ApartmentState == System.Threading.ApartmentState.STA)
{
EventLog.WriteEntry("SvcTest","Single Thread Apartment");
}
else
{
EventLog.WriteEntry("SvcTest",Thread.CurrentThread.ApartmentState.ToString());
}
To my surprise, it's still showing the CurrentTread.ApartmentState as "MTA" (Multi-Threaded Apartment).
Can someone explain this.. .
Stanley
|
|
|
|
|
jbx1828 wrote:
static void Main()
{
Thread.CurrentThread.ApartmentState = System.Threading.ApartmentState.STA;
}
Try changing it to this:
[STAThread]
public static void Main()
{
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
|
Any help is greatly appreciated.
I've made a few changes.
<br />
[STAThread]<br />
static void Main()<br />
{<br />
Thread t = new Thread(new ThreadStart(WorkerThread));<br />
t.ApartmentState = ApartmentState.STA;<br />
t.Start();<br />
}<br />
<br />
static void WorkerThread()<br />
{<br />
ServiceBase.Run(new System.ServiceProcess.ServiceBase[] { new TestSvc() });<br />
}<br />
and in the onStart Method, when window services starts, it stills show
thread as MTA. I am just LOST... Unless, there is something I'm missing here.
Stanley
|
|
|
|
|
I am new to C# and I am having some problem understanding arrays. I am getting the following exception:
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
The problem seems to be (string)ie.Current. I do not understand why I cannot retrieve the value. Any ideas would be appreciated.
<br />
using System;<br />
using System.Collections;<br />
<br />
namespace ConsoleApplication2 <br />
{<br />
<br />
class Class1 <br />
{<br />
<br />
[STAThread]<br />
static void Main(string[] args) <br />
{<br />
Hashtable region = new Hashtable();<br />
IDictionaryEnumerator ide;
ArrayList al;<br />
IEnumerator ie;
string indicator = ""; <br />
<br />
do <br />
{<br />
Console.Write("Enter region name: "); <br />
region.Add(Console.ReadLine(), new ArrayList()); <br />
<br />
Console.Write("Enter another region? (y/n): ");<br />
indicator = Console.ReadLine();<br />
<br />
} while(indicator.ToUpper() == "Y");<br />
<br />
ide = region.GetEnumerator();<br />
while (ide.MoveNext()) <br />
{<br />
al = (ArrayList)ide.Value;<br />
al.Add("foo");<br />
}<br />
<br />
ide = region.GetEnumerator();<br />
while (ide.MoveNext()) <br />
{<br />
al = (ArrayList)ide.Value;<br />
ie = al.GetEnumerator();<br />
while (ie.MoveNext()) <br />
{<br />
Console.WriteLine("hash key: {1} array value: {2}",(string)ide.Key, (string)ie.Current);<br />
} <br />
<br />
Console.WriteLine(ide.Key);<br />
Console.WriteLine(ide.Current);<br />
}<br />
<br />
Console.ReadLine();<br />
}<br />
}<br />
<br />
<br />
}<br />
|
|
|
|
|
Have you made sure that ie.Current is a string ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Yes, actually I cast it just in case:
(string)ie.Current
|
|
|
|
|
I can see that you cast it, and I'm sure there is a magical world in which this will always work. Have you stepped through to make sure that it is a valid target for this cast, and checked what the value is when it fails ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
When I step into the program I see that ie.Current is equal to "foo" as expected. However, before it prints the line it throws an exception and highlights ie.MoveNext(). But, if I remover {2} from the string it operates as expected.
Like I said I'm new to C# so please bare with me as I may be missing something simple.
Thanks
|
|
|
|
|
Got it. The format string is zero indexed - you are asking for values 1 and 2, but the values you provide are numbers 0 and 1, hence the error on array indexing.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
This may be a stupid question but based on my code sample, how would I go about fixing the problem? I've been pulling my hair on this one for quite some time.
Thanks -- I owe you a beer for this one!
|
|
|
|
|
*grin* I remember when I was starting, asking questions that seemed impossible to me, and feeling dumb when I found out the answer. I recommend the book 'Inside C#' by Tom Archer. Make sure you get the second edition.
Replace the 1 with a 0, and the 2 with a 1. That way you're asking for the first two items specified, rather than the second and third ( currently non-existent ) item.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|