|
You don't need crystal reports to display a graph there are plenty of graph and chart controls available. Look for Microsoft chart controls http://www.microsoft.com/downloads/details.aspx?FamilyId=130F7986-BF49-4FE5-9CA8-910AE6EA442C&displaylang=en I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Interesting. Thanks alot. Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
I have (button1 in my form)
string nameProp = "button1.Text";
how can i set this property for button1.
|
|
|
|
|
Start by reading a book. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
What do you mean ?
Can u help?
|
|
|
|
|
You can do like this
Control[] controls = this.Controls.Find("button1", true);
if (controls.Length > 0)
{
Control control = controls[0];
PropertyInfo[] properties = control.GetType().GetProperties();
foreach (PropertyInfo controlProperty in properties)
{
if (controlProperty.Name == "Text")
{
controlProperty.SetValue(control, "My new Value", null);
}
}
}
-----------------------------
Shakeel Iqbal
------------------------------
My New Article
Task Manager
|
|
|
|
|
I know this one!
I want something like this :
string butt = "button1.Text";
(Button)butt="New Value";
|
|
|
|
|
It can't be done the way you want. You have no choice but to use reflection as was demonstrated.
|
|
|
|
|
Hi..
Im new for windows applications.. i hav one doubt.. Im using vs 2005 and sql server 2005 Sqlexpress.. i need to get backup & Restore Databases..
im trying and got it through c# code (using smo). After successfully im create exe in my application and run client machine.. client machine have some project with DB..(DB mdf and log file Path is c:\test1\test2\test3) i want to get client machine DB backup Restore..But client machine installed only express edition not a management studio..
in this case how to get DB backup and restore in client machine..
Pls help me.. wat can i do..?
|
|
|
|
|
Sivaooty wrote: in this case how to get DB backup and restore in client machine..
Pls help me.. wat can i do..?
You'd need to distribute the appropriate files. There's a convenient package here[^] I are Troll
|
|
|
|
|
Hello friends,
I've an application which requires the interception of the network communication functions like send() & recv() and to get the data of these functions. Can anybody please provide the link for the source code on how to achieve this in C#.
Thanks in Advance.ritz1234
|
|
|
|
|
i searched no this to set the time out , i found that there is no such method and by default it waits 15 seconds, and i saw a sample using a timer , but need to know a better solution for this , is any idea ?
|
|
|
|
|
Using asynchronous methods and a timer is pretty much how you do it. If you aren't happy with that then you could create a wrapper class that hides all of the details and offers a Connect(address, port, timeout) method to make things easier for yourself.
|
|
|
|
|
|
i have obtained all the open connections in local machine , now i want the user to select connection that he wants to disconnect , so the problem is how can i end a connection from my application
|
|
|
|
|
First, you don't. Doing so would more than likely cause the app that opened it to crash.
|
|
|
|
|
sallam jojoba
منم عسل هر وقت اومدي پيغام بده چت كنيم
|
|
|
|
|
You have been told before. English!
كنت قد صرح من قبل. الإنجليزية! I know the language. I've read a book. - _Madmatt
|
|
|
|
|
به شام چه دخالت ميكنيد تو كار مردم
|
|
|
|
|
i googled for this and came up with only visual basic code not c#
I'm sure that i had to somehow make an event handler for this but unfortunately for me i'm too new to understand how to do this
|
|
|
|
|
By click you mean when a tab is selected? Use the SelectedIndexChanged[^] event I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Code :
public static uint GetUintFrombyte(byte[] ByteArry)
{
string Array = ByteArray.ToString(); /OR/ string Array = BitConverter.ToString(ByteArray);
int Value = int.Parse(Array, NumberStyles.HexNumber);
uint Value2 = Value;
return Value2;
}
Now here i read 4 bytes
Binary reader : byte[] Hex = br.ReadBytes(4);
Hex Now ='s 00000001
00000001 to a int value should = 1 then transfering it to a uint , but it isnt seemingly doing it .
Error comes up as on int value "Error : Invalid Format "
Any Help ?
Thanksmodified on Sunday, February 7, 2010 11:58 PM
|
|
|
|
|
I solved it , Here is the code :
(new Class)
public static string HexToAscii(byte[] hex)
{
string ascii = "";
for (int i = 0; i < hex.Length; i++)
{
string temp = hex[i].ToString("X");
if (temp.Length == 1)
temp = "0" + temp;
ascii += temp;
}
return ascii;
}
public static uint BytetoUint(byte[] Data)
{
string Array = Conversions.HexToAscii(Data);
int i = int.Parse(Array, NumberStyles.HexNumber);
return Convert.ToUInt32(i);
}
|
|
|
|
|
That is some terrible code.
xEvOx wrote: public static string HexToAscii(byte[] hex)
bad method name, nothing is hex unless it is a string holding the hex representation of something.
should be ToHexString(byte[] bytes)
xEvOx wrote: string temp = hex[i].ToString("X");
if (temp.Length == 1)
temp = "0" + temp;
use ToString("X2") to always get at least two characters
xEvOx wrote: string ascii = "";
in /NET all strings use Unicode, not ASCII.
xEvOx wrote: public static uint BytetoUint(byte[] Data)
another bad method name, it does not convert a byte, in converts a byte array.
and a very inefficient way to do things: you have numbers in the byte array, turn them into a string in order to extract a numeric value. One should never do that, just work with the numbers themselves, something like (untested):
public static uint ToUint(byte[] bytes) {
uint result=0;
foreach(byte b in bytes) result=(result<<8) | b;
return result;
}
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Just wondering why this block of code will not clear out databound textboxes that are inside a tab control that is grouped inside a groupbox?
private void add_Button_Click(object sender, EventArgs e)
{
foreach (Control c in this.Controls)
{
if (c is TextBox)
(c as TextBox).Clear();
if (c is CheckBox)
(c as CheckBox).Enabled = false;
}
}
I'm trying to reproduce the same type effect of when the add button is pressed on the tool strip. thanks
How I got it to work if anyone is interested:
private void add_Button_Click(object sender, EventArgs e)
{
bindingNavigator2.BindingSource.AddNew();
}
I just simply had to call the addnew() method on the bindingnavigators bindingsource to put it in add record state.
Thanks to all that helped me with this issue I really appreciate it.modified on Friday, February 12, 2010 10:29 PM
|
|
|
|