|
Thank you so much, it works very well !
By the way, do you know if it is possible to do it directly by my stored procedures ?
|
|
|
|
|
I don't know anything about stored procedures. Perhaps you could post in the SQL forum to see if there is a way to do that.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
why would you want a stored proc to do this? Stored procs are for retrieving data, not formatting it for display.
|
|
|
|
|
because, now, I'm using GridViews which are databinded directly by stored procedures. So if it is possible to format my results inside my stored procedures before databinding, it will be much more simpler for me !!!
|
|
|
|
|
no, its not because you have exactly the same formatting ability when databinding
Eval("myNumericNumber","E2")
|
|
|
|
|
Hi,
I have just did the test: it seems to be not working very well ?!
As result, I have "E2" !
Are you sure that using Eval("myNumericNumber", "E2") when databinding gives the same result that formatting in C# by: myNumericNumber.ToString("E2") ?
|
|
|
|
|
Hi,how can i maintain the position of the scrollbar on ostback.
Page.MaintainScrollPositionOnPostBack = true;
i tried,its not working for me....
im using updatepanel...
Hi,Im Razana
|
|
|
|
|
hi
iam new to .net.can anyone tell me how to do paging in datalist and also i want to display like
"page 6 to 10 of 100" information in the footer.can anyone tell me how to do this?
Thanx in advance
pintoo
|
|
|
|
|
Hi,
I created a project in c#.net using MySql as database. I created a setup and installed it into another client machine but at the time of installation i need to check whether MySql database exist in the client machine.Is this possible in C#.net? Plz Help Me
Thanks in Advance
Smithakrishnan
|
|
|
|
|
connect the database , it will throw the exception,
from the exception you can easily find, the database is not found!.
|
|
|
|
|
I want to copy the subitems in a Listview, then I found it does not support this function?
how to do then?
thanks.
|
|
|
|
|
Overload the keypress and keydown messages for the listview, then listen for the event "Ctl-C". Once the event occurs, copy the selected contents to the clipboard. You could also add a context menu to the list view, and have copy as an option within the dropdown. On click, you would do the same thing as when the user presses Ctl-C. Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
On closing the form i need to save some data so in which event should i call the function to save data.
i am doing it inside Form1_FormClosed();
but if the data is not proper it should return from there..it is returning but closing the form.
Is there any handler which gets called before Form1_FormClosed() event.
ThankXXX In Advance.
Truth Is The Simplest !!!!
|
|
|
|
|
FormClosing...
|
|
|
|
|
You can write that code in FormClosing() and set the FormClosingEventArgs.Cancel property to true.
I don't mean to be harsh, but the very first result for cancel formclosed[^] brings up the answer.
Cheers,
Vikram.
"I will put my new found knolage to good use" - Captain See Sharp.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.
|
|
|
|
|
Hi Friends..
I nee to get Mac address of a Remote machine for which i am using VC++ dll method("iphlpapi.dll") to do so..I am using the followin C# code to get the MAC Address..
public class clsMacAdd
{
[DllImport("iphlpapi.dll", ExactSpelling=true)]
public static extern int SendARP( int DestIP, int SrcIP, [Out] byte[] pMacAddr, ref int PhyAddrLen );
public static string GetMacaddress(string strHostName)
{
System.Net.IPHostEntry Tempaddr = null;
string[] Ipaddr = new string[3];
//strHostName = Request.UserHostName;
if ( strHostName == "127.0.0.1" )
{
strHostName = "system102";
}
Tempaddr = (System.Net.IPHostEntry)Dns.GetHostByName( strHostName );
System.Net.IPAddress[] TempAd = Tempaddr.AddressList;
foreach(IPAddress TempA in TempAd)
{
Ipaddr[1] = TempA.ToString();
byte[] ab = new byte[6];
int len = ab.Length;
// This Function Used to Get The Physical Address
//int r = SendARP(int(TempA.Address), 0, ab, ref len );
int r = SendARP( (int) TempA.Address, 0, ab, ref len );
string mac = BitConverter.ToString( ab, 0, 6 );
return mac;
}
return null;
}
}
}
I am getting the MAC address when i run in enterprise network(local),but when i host it a web server(live) i couldn't get the MAC Address..Wat could be the problem..? Someone help in this regard as early as possible..
Regards,
Balaguru
|
|
|
|
|
I have N numbers of object floating inside of WPF window. I can rotate any object through by selecting with combo box and then by pressing a button. It works fine, but it is not maintaining its position. When second time I want to rotate it does not move, which implies that after rotating it did not keep the latest position.
For just debug purpose I change the angle, but still it rotated from its starting position, but not from last position.
How we can animate (from angle 0 to 90)? Do I need to write storyboard for each object in XAML? Looks odd! Or is there way to write dynamically storyboard.
Your prompt answer will be very much appreciated.
Agha.khan@hotmail.com
|
|
|
|
|
The problem might be the following:
after assigning an animation to a element the animation will run to it's endpoint and stay there!
So if you try to change the propertie (say angle) itself it won't have any effect to the element cause the animation is still in place and has precedence.
So either you remove the animation (just assign a null animation) or you plug another animation on top (I advise removing animations after they run through - just don't forget to save/reset the changed values)
|
|
|
|
|
This part I am missing. How can we save the values? Is there any API for saving values? Thanks for reply.
Best regards
Agha Khan
|
|
|
|
|
If you are using a storyboard instead of BeginAnimation directly you can handle a event - telling you when the stroyboard finishs - there you just save the old value in a local variable, set the storyboard/animations of the element to null and reassign the value to the property - that's it.
This works because:
- the properties are reflecting the values assinged by the storyboards progress but you can't set them because the storyboard will override them
- by setting a null storyboard to a element you will erase all existing storyboards
- after this you can use the properties just like you used to
Here is an example using AxisAngleRotations, this code runs in a Completed-event of a storyboard rotating some WPF-3D elements:
<br />
int iSign = Math.Sign((I.currRotation.Rotation as AxisAngleRotation3D).Angle);<br />
var dAngle = Math.Ceiling(Math.Abs((I.currRotation.Rotation as <br />
AxisAngleRotation3D).Angle / 90.0)) * 90.0 * iSign;<br />
<br />
I.currRotation.Rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, null);<br />
<br />
if ((I.currRotation.Rotation as AxisAngleRotation3D).Angle != dAngle)<br />
(I.currRotation.Rotation as AxisAngleRotation3D).Angle = dAngle;<br />
(you might wonder why I use the ugly "/ 90 ) * 90" ... construct! - Well this code is for a "rubiks cube" and there I only want the finished rotations to be multiples of 90°. But if you use many rotations you might end up at 89.8 or something and this just looks weired)
|
|
|
|
|
Hi guys,
Can someone translate this vb code to C# please???
intCount = objItems.Count
For i = intCount to 1 Step -1
objItem = objItems(i)
objItem.Delete
|
|
|
|
|
Maybe...
int count = objItems.Count;
for (int i = count; i>=1; i--){
objItem = objItems[i];
objItem.Delete();
}
Download reflector, it'll make translation alot easier.
Mark.
modified on Thursday, January 31, 2008 6:58:24 PM
|
|
|
|
|
It translates to:
intCount = objItems.Count;
for (i = intCount; i >= 1; i--) {
objItem = objItems[i];
objItem.Delete();
The Next that is missing from the code translates into the closing }.
The C# code will cause an IndexOutOfRangeException exception, just as the VB code does.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
As Guffa says, it'll generate an IndexOutOfRangeException
First lesson of .net programming, arrays are zero based so you get objItems[0] up to objItems[objItems.Count-1], so you'll need to alter the for loop to something like...
for (int i = intCount-1; i>=0; i--)
{
...
}
Also, if intCount isn't declared somewhere else you're gonna have a problem so maybe
int intCount = objItems.Count;
|
|
|
|
|
I thought VB arrays were indexed from 1....
Cheers,
Vikram.
"I will put my new found knolage to good use" - Captain See Sharp.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.
|
|
|
|