|
Try this code:
foreach(Control ctrl in form1.Controls)
{
if (ctrl is Label)
{
console.write(((Label)ctrl).Text);
}
}
Best regards, Alexey.
|
|
|
|
|
First of all thank you for your answer, but I get this error
An object reference is required for the nonstatic field, method, or property 'System.Windows.Forms.Control.Controls.get'
|
|
|
|
|
Sorry everything is now working thank you very much
|
|
|
|
|
can somebody give me some knowledge about common language runtime and microsoft intermediate language
Thank You
Pankaj Garg
|
|
|
|
|
Such as?? Your question is way to general to answer with anything other than a link to the Develpmer's Guide[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hey guys, I have alot of data and I want to move them from my Excel file to my access Database, So I wouldn't Have to do any Data Entery !
Is there any way I can do it By C# or the fact that both are part of Microsoft Office, there is a way to do such a thing ?!!
can you help me out plz !?!
|
|
|
|
|
create blank database in access,
then use Insert>Table Import Table wizard.
Shajeel
|
|
|
|
|
How can I check string is it valid date using Regular Expression
|
|
|
|
|
|
Hi everyone,
I have a problem re: DataBindings. I binded a textbox with a database in which I would like to show the date in it, but unfortunately I can't remove the time, so that in the textbox the date only is shown. How can I do it? The following is the code I used for databinding.
this.txtDOB.DataBindings.Add("Text", DBHandler.DS, "UserLogInsteacher.DateOfBirth");
Thanks a lot!!
|
|
|
|
|
The Add call returns a Binding[^] object which has a Format[^] event. Use it to format your data.
|
|
|
|
|
I didn't understand you quite well. How can I do that?
|
|
|
|
|
Something like this (not tested):
Binding binding = this.txtDOB.DataBindings.Add("Text", DBHandler.DS, "UserLogInsteacher.DateOfBirth");
binding.Format += new ConvertEventHandler(binding_Format);
and
private void binding_Format(object sender, ConvertEventArgs e)
{
DateTime dt = (DateTime)e.Value;
e.Value = dt.ToShortDateString();
}
Some error handling etc should be added (like checking for DbNull etc.)
|
|
|
|
|
Hi,
i'm trying to create a dialog in c#, that populates a listbox with built-in users, on an xp, yet it should allow the user to browse for users from active direcotry outside their local machine.
actually i'm trying to mimic a dialog that shows in:
SQLServer2000 Enterprise Manager/security/logins/new login/browse button (...)
please advice, and many thanks in advace.
|
|
|
|
|
hi eyad do want to retrive the onfo. about users in the active directory domain.
|
|
|
|
|
i think this code will help you ;
but first you should sign on the domain as a administrator
then add the active directory refference to the code below:
////
//
//
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.DirectoryServices;// the active dirctory library
namespace abdallah1
{
///
/// Summary description for WebForm1.
///
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.ListBox ListBox1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
private void retrivedata(string strDoamin)
{
DirectoryEntry obDirEntry = null;
try
{
obDirEntry = new DirectoryEntry("WinNT://" + strDoamin);
DirectoryEntries entries = obDirEntry.Children;
foreach (DirectoryEntry chil in entries )
{
if ( chil.SchemaClassName =="User")// to retrive the user only
{
ListBox1.Items.Add( chil.Name + "//" +chil.SchemaClassName);
}
}
}
catch (Exception ex)
{
Trace.Warn(ex.Message);
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
retrivedata ("nwtraders");
Label1.Text="Data retrived sucssfully";
}
}
}
////////
|
|
|
|
|
Thanks alot abdallah for your help, it worked great.
|
|
|
|
|
:->hi every one ,
i need some info. about rational rose model , its related with softwear eng.
so any info. will be usful for me .
my best Regards for all.
abdallah zaid
|
|
|
|
|
|
:->thx for your help alexey ,
my regards.
abdallah ziad
|
|
|
|
|
please give idea or any help this issue:
how to rotate images in cycle with link.
description:
iam developing project to the musium.There various type of ancient type Categoriesare available. I have devided all in 6 Categories,so i like to rotate all Categoriesin cycle with picture.further more each Category has link that related to other information. Please give Ideas to begin project.
Amal
SOFTWARE DEVELOPER
|
|
|
|
|
hi Amal,
please clarify the terms you used: "rotate", "cycle" and "link"
did you mean with "rotate" turning clockwise and counter-clockwise an image canvas ?
or did you mean some sort of a CROSS JOIN between two entities ?
write in arabic if you like.
best regards.
|
|
|
|
|
my project likes encanrta 2005 interface .
rotate -clockwise or unti clock wise
in Encarta 2005 images have been rotating with links,that each links has own information
plese urgent
Amal
|
|
|
|
|
hi why don't u use an adrotator control.
hi to all
with regards,
susa
|
|
|
|
|
Does anyone know how to synchronize two databases (prefarebly mySQL) on different servers through C#?
What confuses me most is the comparing of the two databases. Note that the two databases can have the same data due to previous synchronizations. Also, the two databases can have different data but the same primary key.
Thank you
Elaine
|
|
|
|