OK, I'm not sure if I understand your problem, but you need to do three things.
1. Create a property in the dialog (form) you wish to display so that you can extract the information out of a textbox.
public class Welcome : System.Windows.Forms.Form
{
...
public string Payment
{...
Hi there,
Actually, you need to use NextResult for every result set you request after the first one.
The fact that you use the GetXXX is good. These methods return typed information which do not require further conversion and thus are the ones to use if you absolutely must use a DataReader...
Hi there,
You can create a Windwows service. That way, you can run it in it's own security context.
There's a template (Windows Service) when you create a new project. You will also need to create an installation. There is a great article in the MSDN library which will walk you though the...
Just to put my 2c worth...
you can use the following:
string str = "2.354";
float flt = float.Parse(str);
The Parse method is handy because it exists for every built-in function and a few more objects besides.
The Parse method for the float type also has an overload which allows you to...
Hi,
That is OK if you already reference System.Windows (as the Application class is defined in there)
A more generic way is to use reflection:
using System.Reflection;
...
// There are a few possiblilities here.
// Look at the doc for the Assembly class
Assembly assbly =...
Hi,
I think what you're trying to do is instantiate various objects depending on the situation.
One way is to instantiate the object before you enter the AddItem method and pass it as an argument:
MySpecialObject obj = new MySpecialObject();
anobject.AddItem(obj);
...
public class AnObject...
Hi there,
You need to iterate on the Controls collection of the form.
For instance:
foreach (object obj in this.Controls)
{
if (obj is TextBox)
{
TextBox txt = (TextBox)obj;
// do something
}
}
Hope this helps.
Cheers!
Hi,
Yes. You can use a web service in a windows app.
1. Right-click on the windows project
2. Click on Add Web Reference
3. Type in the URL of the web service
This will create a proxy class for you in your project which will handle all communicaiton for you to and from the webservice. If...
Hi,
Since a user control (ascx) is a class and self-contained, the only way to communicate is to use properties.
If, for instance, you have a Textbox (txtLastName) on your form, write a property to access it.
public string LastName
{
get
{
return txtLastName.Text;
}
set
{...
Hi,
Both the posts are right.
However, because the string cannot change size once it is allocated, it is better to use a System.Text.StringBuilder if you want to concatenate or play around with the string. Allocation of a StringBuilder object is dynamic and much more performant.
It has...
Hi,
I'm not sure at what moment you're trying to run this, but the controlling program needs to be in the same scope.
For instance:
If you were trying to display a splash screen, you would write the following:
[STAThread]
static void Main()
{
Form1 frm = new Form1();
frm.ShowDialog()...
Hi,
The trick is to work the .NET way and use a custom enumeration. This makes your code much more readable.
For instance, Before the declaration for your first form (you can also create all enumerators ina seperate file), declare a new enumerator:
public enum MenuSelected
{
None,
ItemOne...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.