|
Message Closed
modified 23-Nov-14 7:24am.
|
|
|
|
|
but serialization uses assembly specific data.
how to do it if the client and server is in different assemblies? but the structure is exactly the same?
I do not want to encode specific assembly to be used as reference in both client and server, that will serialize/deserialize the data.
Чесноков
|
|
|
|
|
|
what is that???
Чесноков
|
|
|
|
|
Hi all, crystal reports are new for me. i need help for creating a report having two parameter which takes Start Date and End Date which contain the range of dates and when i select dates it show related reports.i want to fix date ranges at run time using C# code.
I take a code from an article but it doesn't work.
If u have any article plz give me link i will consult it.
advance thnx 4 help
|
|
|
|
|
i code a connection string in web.config in appsetting now i want to use that connection in dropdownlist which i want to bind through wizard. How i give that connection using wizard to bind it???
|
|
|
|
|
Try the ASP.NET forum
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
This should really be posted in the asp.net forum, bur the process is the same as for winforms.
First, move the connection strings from the AppSettings into the specialised connectionStrings section(you'll have to google for this as I'm replying from my phone). This has a few advantages, first you can get a Connectionstring object, the connection strings can be encrypted in config separately and (most important in your case) the connection strings are now separate from the other app config.
Now all you need to do is iterate over the set of connection string and add the names to the dropdown list. Note that sending the strings themselves down to the client is a security risk. Once the client has responded with a selected name you can use it to look up the string from the config.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
I have been trying to figure something for last couple of hours, but i'm unable to solve it & need some help.
I have project with 2 forms:
Form1 - MDI container
child_form1 - parent set to Form1
on menu_form i have MenuStrip called "MenuStrip1" and item called "item1".
on the item1 i have following code:
private void item1_Click(object sender, EventArgs e)
{
child_form1 cf1 = new child_form1();
cf1.MdiParent = this;
cf1.Show();
}
now, for problem, i want to be able to modify Form1 menustrip items from the child menu. (specifically i want to uncheck the item1 when form is closed, but for the argument sake i just need to get proper handle/pointer to menu item).
So i've tried doing something like this:
Form main_form = this.MdiParent;
main_form.Controls["menustrip1"].Controls["item1"].Checked = false;
but it seems i can only get pointer/handle to the menustrip as a whole, but not to the item itself.
main_form.Controls["item1"] is not valid pointer
main_form.Controls["menustrip1"].Items does not exists
Am i missing something ??
How do i get handle to form's menustrip item(s) from another child form ?
Would appreciate any help in resolving the issue...
EDIT:
i managed to solve the problem myself, leaving msg as it might help others with same problem.
modified on Saturday, October 31, 2009 4:38 AM
|
|
|
|
|
I found the problem.
The modifiers of the menu item were set to "private", so child form could not "see" it.
Now i've changed to "Public" and this code allow to access it:
Form1 main_form = this.MdiParent as Form1;
main_form.item1.checked = false;
|
|
|
|
|
THat is not a good idea - it works, but it is considered bad practice. Why? Because it locks the child form to the design of the parent form. You cannot now change the design of the parent form unless you check that this will have no effect on the child form.
The recommended way to do this is to generate an event in the child form which is subscribed to and handled by the parent form. The parent form then takes the action depending on what controls it is using.
To do this:
In the child form:
public partial class frmChild : Form
{
public event EventHandler Changed;
protected virtual void OnChanged(EventArgs e)
{
EventHandler eh = Changed;
if (eh != null)
{
eh(this, e);
}
}
private void DoSomethingToChangeData()
{
OnChanged(null);
}
}
----- The assign to eh is in case the handler changes between null check and exec. (Unlikely, but possible)
----- The null check is to ensure there is a handler. If not, better to ignore it gracefully, than to rely on the thrown exception (NullReferenceException)
In the Parent form:
public frmParent()
{
frmChild.Change += new frmChange.ChangeHandler(Changed);
}
private void Changed(object sender, EventArgs e)
{
}
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
thank you for the reply.
I'll do as you advised.
|
|
|
|
|
this code not work in my project so i m doing ao\nother code but this code only one item to be access i want all items access on mdiparent.
my code is
Form 1:
private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
{
// richTextBox1.Paste();
try
{
Form frmChild = this.MdiChildren.First(frm => frm.Name == "@new");
RichTextBox txt = (RichTextBox)frmChild.Controls.Find("richTextBox1", true)[0];
txt.Paste();
//MessageBox.Show(txt.Text);
}
catch (Exception)
{
MessageBox.Show("frmChild is not open");
}
}
|
|
|
|
|
Dear All,
I am using the bellow lines
mshtml.HTMLHeadElementClass elDynHead = null;
foreach (IHTMLElement elcol in (IHTMLElementCollection)document.getElementsByTagName("HEAD"))
{
if (elcol.ToString() == "mshtml.HTMLHeadElementClass")
{
elDynHead = (mshtml.HTMLHeadElementClass)elcol;
}
}
it works in Develpement system, but not in the client system
it throws the following error
Error :: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'mshtml.HTMLHeadElementClass'. COM components that enter the CLR and do not support IProvideClassInfo or that do not have any interop assembly registered will be wrapped in the __ComObject type. Instances of this type cannot be cast to any other class; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
at PAW_URL.clsURLMON.browser_DocumentComplete(Object pDisp, Object& URL)
so i think i have to Register mshtml in GAC.
But i dont know how to do it.
can some one help me how to Register the mshtml.dll in to GAC.(urgent please)
thanks in Adavnce
|
|
|
|
|
jasome wrote: so i think i have to Register mshtml in GAC.
You are utterly wrong. The mshtml DLL is obviously not present on the target system. It's a COM dll, that's what the error message says. Therefore, it's almost certainly not .NET, and cannot be put in the GAC.
If you were to google the error message, you'd get a ton of previous questions like this[^] one.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi Thanks,
Do you have any idea ? How to overcome this problem.
if it is please do guide me
thanks
|
|
|
|
|
Hi all,
any way i'v found the solution.
we need to run a exe called "vs_piaredist.exe"
thanks to all.
|
|
|
|
|
Because it installs it, right.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
I want to get the current speed of writting into or reading out from my hard disk.
How can I make that? Is there any code resouces ?
|
|
|
|
|
Write a big chunk of data and time it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Sorry.It's my fault.
I don't want the speed,but the throughput in a period,for example,in one minuter.So how to realize it?
|
|
|
|
|
OK, in that case, I have no idea.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Perhaps over WMI[^]?
I are Troll
|
|
|
|
|
I am starter in C# programming and I tried my hands at multi-threaded programming.I used an algorithm and run its thread concurrently to call a function which has the following body.
lock (currlock) {
if (N[int1] > N[int2]) {
temp = N[int1];
N[int1] = N[int2];
N[int2] = temp;
}
}
I call showArray(N); before and after the execution of the sorting code.
If I run this code there will be no error but the output array displayed will seen unsorted.
However, if I uncomment the showArray(N); or if I put any Console.writeline("..."); the array displayed will come sorted. I am very much surprised as well as confused on this issue... I can't resolve it... I thank you in advance for any help.
Raj
|
|
|
|
|
niranjanR wrote: I am starter in C# programming
niranjanR wrote: multi-threaded programming
These two concepts are mutually exclusive. Learn C# first, then worry about multi threading.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|