|
|
Hi senthilu.,
Try this
using System.IO;
private Button1_Click(.......)
{
try
{
File.Delete(Server.MapPath("..//filename"));
Label1.Text="completed";
}
catch(Exception exe)
{
Label1.Text="error : "+exe.Message;
}
}
best regards.,
ranandbe
|
|
|
|
|
Hi!.
I am developing a web based whois lookup page for my site. But while trying to connect to a remote whois database "whois.wildwest.net" and port "43" its showing the error "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond". The stack trace is :-
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond]
System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port) +578
giwia.development.temp.whois.Button2_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\giwia\development\temp\whois.aspx.cs:65
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +58
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
. I am using Framework 1.1.
Please help me to solve this problem. Its working in local host. But it cant on web space.
Thanx in advance
JIJO BABY - Lets Play C#
|
|
|
|
|
It means the host is not responding. Try to: telnet whois.wildwest.net 43 and you will see it fails.
|
|
|
|
|
hi all, i need to store word document into sql server,they are give by the user,and my qustion is how much space it will occupy in the database when i store this word document (using stream reader i read the entire document and pass this value into string and i pass this string value into the database)i feel it will occupy more space on the db.(can any one say how much space will occupyed the 150kb word document?)
is there any way to reduce the size of the document?
very urgent....help me plz....................
|
|
|
|
|
hello,
In my application i want to diaplay all properties in a control of dialog box and if user modifies it, this should be saved.
So, is there any way to know about the proerties of my applcation which can be displayed in a grid. I want the same user interaction like property window of C# form application.
or it can be explained as
I was looking for a way to access all the available properties of a given object. for ex. I would like to do some thing like
SomeClass obj1;
foreach( property p of obj1 )
{
// Do something with property
}
Is there any thing which any of you can suggest on this.
Thank You.
Gajesh
Pune(india)
-- modified at 2:09 Friday 2nd June, 2006
|
|
|
|
|
See this: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/usingpropgrid.asp
|
|
|
|
|
Hi,
I have a VB application using a .Net(C#) dll.I made the application wait for particular time from the .net dll and during the wait if i move between other open windows,the VB application gets hanged or becomes blank screened.
I tried using System.Windows.Forms.Application.DoEvents() to repaint the Vb application but it is that effective but of course makes little difference.
I totally clueless
Do not wait to strike till the iron is hot; but make it hot by striking.
|
|
|
|
|
I got the same problem, but I made my program wait until another program is loaded.
I´ve overcome this problem by making a loop on a timer, so It checks every 300ms if the program is loaded, so it´s not needed to wait anymore. =D
-- modified at 1:44 Friday 2nd June, 2006
|
|
|
|
|
Do the waiting operation on a separate thread[^]. That way, the UI will remain responsive while you wait.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I'm a begginer programming in C#.I am studing about assembly in C#.
I don't know what is assembly?
how do a file *.dll create?
Using a file .Dll ?
usefull of *.dll, or assemble
Thank you.;)
nguyenquang
|
|
|
|
|
|
Thank you Darren Marshall.
|
|
|
|
|
Hi
I need some help with coding my class.
I want to create 2 different types of TabPages that will appear on my single TabControl. For eg. a CustomerTabPage and EmployeeTabPage. So I assume I should create 2 customised TabPage classes?
So if im receiving an employees details i will create an instance of Employee and create an instance of EmployeeTabPage(myEmployee) and pass it myEmployee to create a tab page that is unique to employees and adds all myEmployee's data to the labels on that tabPage.
Now the problem I have is how do I add the controls that will appear on my CustomerTabPage or EmployeeTabPage? do I code it in each class of TabPage that I created?
plz help!
|
|
|
|
|
Same way you'd add controls to an inherited Form:
<br />
...<br />
this.Controls.Add([some control]);<br />
...<br />
<code> <br />
<br />
-Daniel<br />
Typing too fast fro my owngood
|
|
|
|
|
thanks for the reply.
where do i add that code? do i put it in my TabPage constructor?
Im a beginner,sorry.
|
|
|
|
|
Are you going to have more than one Employee Tab Page open at any time or likewise more than one Customer tab open. If you're not then it's an overkill to create an inherited tab control.
If you are using more than one instance of each type of tab control then basically you need to do this:
- Inherit from a TabPage (easiest way to do this would be to add a UserControl to the current project from VS and then view the source code and change it to inherit from a TabPage).
- Add all the code required for these tab pages.
- In your event handler / what ever you are using to add tab pages replace:
this.tabs.Pages.Add(new TabPage()) with this.tabs.Pages.Add(new CustomerTabPage())
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
hello:
I'm trying to generate code using the CodeDom, and I need to know how to get an expression from an assign statement.
I'm using CodeBinaryOperatorExpression but I get the generated code within parenthesis, for example:
( a = 0 );
I'd like to know if I can get the code without parenthesis using the previous class or someone else.
Thanks
Pablo Hernandez Valdes
|
|
|
|
|
CodeBinaryOperatorExpression is always going to use the parentheses. This way it can always be safe with order of operations. You can't really remove the parentheses using CodeBinaryOperatorExpression . What you may want to try, if you can, is to use a CodeSnippetExpression . If the expression will work in all the languages you're generating, then you're fine. Otherwise, you have to live with the parentheses.
|
|
|
|
|
I know how to connect to a database on a networked machine using C# code directly, thats pretty simple. But I'm trying to use things like data grid forms that have to just select the data source. Using the Data Source Wizard I can't figure out how to tell it to connect to machine X, database X, pass X, username X just like I would using code. It keeps insisting I connect it directly to a database file, which isn't shared. Am I missing some REALLY obvious answer?
-- modified at 17:15 Thursday 1st June, 2006
C# Express 2005 Doesn't have this feature?
|
|
|
|
|
What type of database are you connecting to? I'd assume based on your comments so far that it's an access database in which case you must specify the a valid network path to the database, e.g. \\machineX\c\database.mdb in the connection string, the username and password can also be specified in the string if requried.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
"data source wizard for SQL" is the topic, so I'm not connecting to access =P
I just got a full copy of 2005 from work and solved my problem. I dont think the data objects are predefined and all that in Express for a server connection.
|
|
|
|
|
guys i created a program in c# that works with the phoneline but i am stuck my programmes works per4fect at times but then in some instances i get this error
:::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at MySerialPortReader.CallAccountingService.doInsert( IEnumerable arr)
at MySerialPortReader.MainFrame.RecvTimer_Tick(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
MySerialPortReader
Assembly Version: 1.0.2319.21736
Win32 Version: 1.0.2319.21736
CodeBase: file:///C:/cpp/MySerialPortReader/Release/MySerialPortReader.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
SerialPorts
Assembly Version: 1.0.1649.29449
Win32 Version: 1.0.1649.29449
CodeBase: file:///C:/cpp/MySerialPortReader/Release/SerialPorts.DLL
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
:::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::
but i dont know whats is causing this error to be occuring or how i can handle it properly so it will affect my program
kenny
|
|
|
|
|
keroed_edmond wrote: System.NullReferenceException: Object reference not set to an instance of an object.
at MySerialPortReader.CallAccountingService.doInsert( IEnumerable arr)
at MySerialPortReader.MainFrame.RecvTimer_Tick(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dw
That's the important bit, ignore the rest it's mostly waffle. You're trying to access a null object in CallAccountingService.doInsert . You'll have to step through the code if you don't know off-hand what's causing this. If it seems completely random could it be something to do with the serial port not receiving some data or something like that where it only happens once in a while.
Start with objects that are only dealt with inside the CallAccountingService.doInsert function first since variables dealt with in more than one of the listed functions are less likely to be the cause. Although it all depends on how you've written and structured the code.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Ed.Poore wrote: Start with objects that are only dealt with inside the CallAccountingService.doInsert function first since variables dealt with in more than one of the listed functions are less likely to be the cause. Although it all depends on how you've written and structured the code.
it works some time and others it does'nt the thing is while i am getting the information from the port reader i am simultaneously retrivin information from the database to do soem calcualtaion and then right the data from the port reader along with the calaculated value to the database so i dont know if is a case where when too much information is coming it doe'nt get a chance to handle the calculation and insert the data before more information comes into the system
kenny
|
|
|
|