|
Hello guys, I'm trying to make a client/server com+ application... My com+ class is done and enterprise services really knows it like com+ but when I try to "Export" this application at enterprise services it just enables me to Export as Server Application and I want to Export as Application Proxy.
How to export a .NET COM+ class at enterprise services as an application proxy or how to make this communication beteween 2 pcs.
Thanks...
Wender Oliveira
.NET Programmer
|
|
|
|
|
Hello:
In a web form I’m using a place holder, into it, which contains or not a web user control created ado with next code:
Example.Controls.C1lear();
Control control = this.Page.LoadControl("WebUserControl3.ascx");
Example.Controls.Add(control);
Where Example is my place holder.
Is there some way to ask if place holder contains a web user control or if it’s empty?
I’ll thank you your help.
A.L.
El hombre que tiene amigos debe mostrarse amigo...
|
|
|
|
|
Example.Controls.Count
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Thanks you Rob, also work with Example.HasControls();
El hombre que tiene amigos debe mostrarse amigo...
|
|
|
|
|
I have datagrid that I'm filling with rows, if the rows don't fill up the size of the grid, then I'm adding new empty rows from my dataview in my derived datagrid. The problems that comes up is that when im sorting the columns the empty rows are also sorted (not the last one, and i don't know why the last one is not sorted). Qestion: can i somehow sort the filled rows and just letting the empty (DBNULL) just be in the bottom of my grid?
|
|
|
|
|
I wonder how I can change the highlight color of a ListView control when an item is selected. Thanks in advance.
Radgar
"Imagination is more important than knowledge." - Albert Einstein
|
|
|
|
|
Hi,
I have a table in a Dataset that contains rows for many products. Each row contains Rate of that product. I want to create a new table which would contain Rate of all products discounted at 20%. Is it possible. If yes how?.
My preferred approach is rather then reading each row and then getting the rate i want to apply this dicount for all products at one time.
Nishant
|
|
|
|
|
Hi Nishant,
You can DataColum.Expression property for doing this. This allows you to calculate the values of a colum.
1) Create a new colum with a proper data type.
2) Set the expression property of that coloum . (Ex "rate * 0.8")
3) Add this colum to the table.
The new column is filled with the calculated value.
Hope this will help you.
Regards
SGS
|
|
|
|
|
Thanks a lot, it worked.
But one more thing can i have this column in some other table...
|
|
|
|
|
Hi people,
I have a running small windows forms application on 1.0 and 1.1, but when I use the code on 2.0 beta, it says that the thread cannot access an object that it hasn't created . Can anyone check this out for me please? I have 2 files, one called Main.cs, which is the main program and then I have Ticker.cs which is another window class called from Main. I will post below the whole code for both files, if anyone has any clue about that.
I am using SharpDevelop for 1.1 and Visual C# Express 2005 beta for 2.0
Main.cs
<br />
<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
using System.Threading;<br />
<br />
<br />
namespace Exercice1<br />
{<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
private System.Windows.Forms.Label label1;<br />
private System.Windows.Forms.Label lblText;<br />
private System.Windows.Forms.Button btnClose;<br />
private System.Windows.Forms.Timer timer;<br />
private System.ComponentModel.IContainer components;<br />
private System.Windows.Forms.ProgressBar progressBar1;<br />
<br />
<br />
<br />
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
<br />
}<br />
<br />
protected override void Dispose( bool disposing )<br />
{<br />
if( disposing )<br />
{<br />
if (components != null) <br />
{<br />
components.Dispose();<br />
}<br />
}<br />
base.Dispose( disposing );<br />
}<br />
<br />
#region Windows Form Designer generated code<br />
private void InitializeComponent()<br />
{<br />
<br />
this.components = new System.ComponentModel.Container();<br />
this.timer = new System.Windows.Forms.Timer(this.components);<br />
this.label1 = new System.Windows.Forms.Label();<br />
this.lblText = new System.Windows.Forms.Label();<br />
this.btnClose = new System.Windows.Forms.Button();<br />
this.progressBar1 = new System.Windows.Forms.ProgressBar();<br />
this.SuspendLayout();<br />
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));<br />
this.label1.Location = new System.Drawing.Point(16, 16);<br />
this.label1.Name = "label1";<br />
this.label1.Size = new System.Drawing.Size(264, 23);<br />
this.label1.TabIndex = 0;<br />
this.label1.Text = "Welcome";<br />
this.lblText.Location = new System.Drawing.Point(16, 56);<br />
this.lblText.Name = "lblText";<br />
this.lblText.Size = new System.Drawing.Size(264, 23);<br />
this.lblText.TabIndex = 1;<br />
this.lblText.Text = "Loading XYZ...";<br />
this.btnClose.Location = new System.Drawing.Point(208, 128);<br />
this.btnClose.Name = "btnClose";<br />
this.btnClose.TabIndex = 2;<br />
this.btnClose.Text = "Cancel";<br />
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);<br />
this.progressBar1.Location = new System.Drawing.Point(16, 96);<br />
this.progressBar1.Name = "progressBar1";<br />
this.progressBar1.Size = new System.Drawing.Size(264, 23);<br />
this.progressBar1.Step = 1;<br />
this.progressBar1.Minimum=0;<br />
this.progressBar1.Maximum=20;<br />
this.progressBar1.TabIndex = 3;<br />
this.timer.Enabled = true;<br />
this.timer.Interval = 300;<br />
this.timer.Tick += new System.EventHandler(this.timer_Tick);<br />
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
this.ClientSize = new System.Drawing.Size(294, 175);<br />
this.Controls.AddRange(new System.Windows.Forms.Control[] {<br />
this.progressBar1,<br />
this.btnClose,<br />
this.lblText,<br />
this.label1});<br />
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;<br />
this.Name = "SplashForm";<br />
this.Text = "Loading MyApp...";<br />
this.Load += new System.EventHandler(this.SpashForm_Load);<br />
this.ResumeLayout(false);<br />
<br />
}<br />
#endregion<br />
<br />
private void btnClose_Click(object sender, System.EventArgs e)<br />
{<br />
this.DialogResult = DialogResult.Cancel;<br />
this.Close();<br />
}<br />
<br />
private void timer_Tick(object sender, System.EventArgs e)<br />
{<br />
if (progressBar1.Value != progressBar1.Maximum)<br />
{<br />
progressBar1.PerformStep();<br />
<br />
}<br />
else<br />
{<br />
this.timer.Tick -= new System.EventHandler(this.timer_Tick);<br />
Ticker t1 = new Ticker();<br />
t1.Show();<br />
this.Hide();<br />
}<br />
<br />
}<br />
<br />
private void SpashForm_Load(object sender, System.EventArgs e)<br />
{<br />
if (progressBar1.Value == progressBar1.Maximum)<br />
{<br />
<br />
}<br />
}<br />
protected override void OnClosing(CancelEventArgs e) <br />
{<br />
this.Dispose();<br />
Environment.Exit(0);<br />
<br />
}<br />
[STAThread]<br />
static void Main() <br />
{<br />
Application.Run(new Form1());<br />
}<br />
}<br />
<br />
<br />
}<br />
<br />
Ticker.cs
<br />
using System;<br />
using System.Windows.Forms;<br />
using System.ComponentModel;<br />
using System.Drawing;<br />
using System.Threading;<br />
using System.IO;<br />
<br />
namespace Exercice1 {<br />
<br />
public class Ticker : Form {<br />
<br />
Label label1, label2;<br />
<br />
String[] newsItems =<br />
{ "Safest Aerobic Machine Launched",<br />
"First Dog Cloning Is Only Days Away",<br />
"Reviving the Extinct Tasmanian Tiger" };<br />
<br />
String[] businessItems =<br />
{ "FirstMeasure Software to Go Nasdaq",<br />
"MFMF Directors To Meet For The First Time",<br />
"First Sign of Economic Recovery Finally At Sight",<br />
"Euro Hits Record Low (Again)" };<br />
<br />
<br />
<br />
public Thread NewsThread,BusinessThread;<br />
<br />
<br />
public Ticker() {<br />
Initialize();<br />
StartThread();<br />
}<br />
#region Windows Form Designer generated code<br />
private void Initialize() {<br />
this.Height = 100;<br />
<br />
label1 = new Label();<br />
label2 = new Label();<br />
<br />
label1.Width = 280;<br />
label1.Height = 30;<br />
label1.Location = new Point(1, 10);<br />
label1.TextAlign = ContentAlignment.MiddleRight;<br />
<br />
label2.Width = 280;<br />
label2.Height = 30;<br />
label2.Location = new Point(1, 40);<br />
<br />
this.Controls.Add(label1);<br />
this.Controls.Add(label2);<br />
}<br />
#endregion<br />
<br />
private void StartThread() {<br />
<br />
NewsThread = new Thread(new ThreadStart(MoveLeft));<br />
BusinessThread = new Thread(new ThreadStart(MoveRight));<br />
NewsThread.Start();<br />
BusinessThread.Start();<br />
}<br />
<br />
private void MoveLeft() {<br />
string labelText;<br />
while(true)<br />
{<br />
<br />
foreach(string item in newsItems)<br />
{<br />
labelText = item;<br />
label1.Text=labelText;<br />
<br />
for (int i=280;i>1;i--)<br />
{<br />
label1.Location = new Point(i, 10);<br />
<br />
Thread.Sleep(10);<br />
}<br />
<br />
Thread.Sleep(500);<br />
}<br />
}<br />
}<br />
<br />
private void MoveRight() <br />
{<br />
string labelText;<br />
<br />
while(true)<br />
{<br />
foreach(string item in businessItems)<br />
{<br />
labelText = item;<br />
label2.Text="";<br />
int textLength = labelText.Length;<br />
<br />
for (int i=0;i<textLength;i++)<br />
{<br />
label2.Text+=labelText[i];<br />
Thread.Sleep(50);<br />
}<br />
<br />
<br />
Thread.Sleep(500);<br />
}<br />
}<br />
}<br />
<br />
protected override void OnClosing(CancelEventArgs e) {<br />
<br />
NewsThread.Abort();<br />
BusinessThread.Abort();<br />
this.Dispose();<br />
Environment.Exit(0);<br />
<br />
}<br />
<br />
<br />
}<br />
}<br />
<br />
Thank you!
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
This is most likely occurring in your tick event handler. Basically, Windows Forms controls (like your progress bar), and indeed all Win32 common controls, cannot be accessed on a thread other than the thread that created the control. Check out MSDN for Control.Invoke and Control.BeginInvoke.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Lies of Our Fathers: A Must-Know About Lent
Judah Himango
|
|
|
|
|
thanks!
I will look into that.
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
You've broken one of the basic rules of Windows UI programming. Only the thread that created the UI can modify the UI. .NET 1.1 doesn't report any exception but I bet you wouldn't have achieved the effect you wanted. .NET 2.0 immediately throws an exception if you try to modify the UI from some other thread.
You'll have to use Invoke/BeginInvoke to marshal the method call on the UI thread.
Regards
Senthil
My Blog
|
|
|
|
|
Hi,
well, the weird thing is that it is actually achieving what I want...After the progressbar finishes, the first window is hidden and the other window opens and you have 2 threads created. One is the right method to move text from right to left and the other is the left method..and they loop forever.
I will try looking into that invoke thing, although I have no idea how it works.
thanks for the tip, I appreciate it
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Hi everybody.
I'm retreiving a DateTime from MS sql server, on two different computers.
Both computers have the same definition in ControlPanel > Regional and language options , and same version of .Net (1.1).
When I cast the DateTime to string, (DateTime.ToString() ), I get on computer #1 mm/dd/yyyy, while in computer #2 I get dd/mm/yyyy.
Where is the problem?
Thanks,
Yaakov
|
|
|
|
|
I am not getting why it is showing differently. Just have a look at you regional settings agian.
And you can use string formats to get your date both date in one format .
DateTime.ToString("dd-MM-yyyy")<br />
or<br />
DateTime.ToString("dd-MMM-yyyy")<br />
or<br />
DateTime.ToString("MMM-dd-yyyy") wiil help you out to get a common format for Dates.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I know about the formats.
However, this doesn't solve my problem, since I can't modify the entire application.
Thanks anyway.
Yaakov
|
|
|
|
|
hi
i write a web application with c#.
it has some pages and thir controls such as:
validators , datagrid , datalist with template column
and they have thir event handler functions.
the application works correctly on local.
{ my system: [windows 2003 server ]}
but when i upload it to the host server , the events dont work correctly.
------------
site address:http://siteavval.com/WebVDir/MainGrps.aspx
error message for:
javascript__doPostBack('MainGrpsList$_ctl0$LBGrpShr','')
|
|
|
|
|
Hi,
Here i m facing one problem with .net console application.I am having one solution (.net project) now due to our requirement we had made one dll out of that project and then from one another console application i had called that dll.Now problem is that when i am running that another project of console application which is having my project dll ,it is giving the error of system.componentmodel.win32 application after running my console application.
Now Main thing is that one some machine our same application is running without error and on some machine it is givign error which i had describe above so after searching i found that this is error due to .net security now can anybody know how to give right of user which allows my console applicaiton to run without error?
where and how to give rights to user so my application run without errors?
montu3377
|
|
|
|
|
Go into Control Panel, Administrative Tools, Microsoft .NET Framework wizards, Trust An Assembly, then specify your application and give it the necessary trust to run.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Lies of Our Fathers: A Must-Know About Lent
Judah Himango
|
|
|
|
|
in C++ i can pass a function a const reference to an object. i find this is normally a good idea, since it assures me that the function will not make any changes to the objects state.
is there an equivalent concept in C#? if i understand C# correctly all instances of objects are references and initial experiments show they are passed as modifiable references.
i am trying to create a tree of objects (representing the sub directories on a CD-ROM), so that i can say to each child "this is your parent", passing a constant reference to its parent in its constructor. a child cannot alter its parent, so i want to enforce this concept in the code.
i have found a C# article on modifier keywords which led me to discover that i can have a read only object. but putting readonly before the parameter type does not compile
if there is no such concept, how do people express the concept "remember this object, but you cannot modify it?"
zen is the art of being at one with the two'ness
|
|
|
|
|
There is no language support for const function parameters. For your case though, you can declare the parent field in the child class as readonly. That means that it can only be set in the constructor/field initializer. Like this
<br />
class Child : Node<br />
{<br />
private readonly Node parent;<br />
<br />
public Child(Node parent)<br />
{<br />
this.parent = parent;<br />
}<br />
public void SomeFunc()<br />
{<br />
parent = new Node(...);
}<br />
}<br />
Regards
Senthil
My Blog
|
|
|
|
|
Hi,
I import a C++ Dll in my C# application.
First I call from C# a C++ function and then I get
a result set from the dll.
The result is a array with 3 dimensions.
How can I get access this array in C#.
Please help me !
|
|
|
|
|
I need to get a new pixel color starting by a green color and another one over this blue semi-transparent at 50%.
I've readed some articles on this forum but i need just 2 lines of code not warking with whole bitmaps.
I know it is a very simple stuff, but i don't know how fuse or join two pixels getting another colored pixel.
i've tried with
myColor.R = Color.Green.R & Color.Blue.R
myColor.G = Color.Green.G & Color.Blue.G
myColor.B = Color.Green.B & Color.Blue.B
it works but it fuse full blue on green, i need to fuse semitransparent blue instead.
Please help me.
thanks
|
|
|
|
|