|
added
using system.data.common
and it now compiles.
Thanks
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi,
I have a problem with Grid view. My client required to click anywhere the grid view row and edit the contents, instead of using Edit button which is combined with Grid view. They don’t want to see the edit button .they want only to click the gridrow and it shoud be turned to edit mode.any one have the idea about this. Please help me!!
Rcnair
|
|
|
|
|
I am trying to check if a picture box control is enpty. I tried
if (picturebox.Image = null)
{
.......
.......
}
but I get an error stating that "connot implicitly convert system.drawing.image to bool" any idea how I can work around this?
a novice
|
|
|
|
|
In c# = is an assignment operator, while you need comparison operator.
|
|
|
|
|
Hi
I'm developing a small desktop client and I'm using the Offline Application Block. When I run my application (both in Debug and Release mode) in Visual Studio 2005 it works fine, but when I publish my application it won't run. I hope someone out there can point me in the right direction since I'm having a hard time finding a solution.
The error:
<br />
Timestamp: 05-02-2008 08:23:14<br />
Message: HandlingInstanceID: 6dadd0fb-233b-44ba-829e-fb4963a24de1<br />
An exception of type 'System.Reflection.TargetInvocationException' occurred and was caught.<br />
-------------------------------------------------------------------------------------------<br />
02/05/2008 09:23:14<br />
Type : System.Reflection.TargetInvocationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br />
Message : Exception has been thrown by the target of an invocation.<br />
Source : mscorlib<br />
Help link : <br />
Data : System.Collections.ListDictionaryInternal<br />
TargetSite : System.Object _InvokeMethodFast(System.Object, System.Object[], System.SignatureStruct ByRef, System.Reflection.MethodAttributes, System.RuntimeTypeHandle)<br />
Stack Trace : at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)<br />
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)<br />
at System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)<br />
at Microsoft.Practices.ObjectBuilder.CreationStrategy.InitializeObject(IBuilderContext context, Object existing, String id, ICreationPolicy policy)<br />
at Microsoft.Practices.ObjectBuilder.CreationStrategy.BuildUpNewObject(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)<br />
at Microsoft.Practices.ObjectBuilder.CreationStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)<br />
at Microsoft.Practices.ObjectBuilder.ReflectionStrategy`1.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)<br />
at Microsoft.Practices.ObjectBuilder.ReflectionStrategy`1.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)<br />
at Microsoft.Practices.ObjectBuilder.ReflectionStrategy`1.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)<br />
at Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)<br />
at Microsoft.Practices.ObjectBuilder.TypeMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id)<br />
at Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)<br />
at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)<br />
at Microsoft.Practices.CompositeUI.Collections.ServiceCollection.BuildFirstTimeItem(Type typeToBuild, Type typeToRegisterAs, Object item)<br />
at Microsoft.Practices.CompositeUI.Collections.ServiceCollection.Build(Type typeToBuild, Type typeToRegisterAs, Object serviceInstance)<br />
at Microsoft.Practices.CompositeUI.Collections.ServiceCollection.AddNew[TService,TRegisterAs]()<br />
at BI2ActiveSalesClient.Infrastructure.Library.SmartClientApplication`2.AddServices()<br />
at Microsoft.Practices.CompositeUI.CabApplication`1.Run()<br />
at BI2ActiveSalesClient.Infrastructure.Shell.ShellApplication.RunInReleaseMode()<br />
<br />
Additional Info:<br />
<br />
MachineName : XXXXXXXX<br />
TimeStamp : 05-02-2008 08:23:14<br />
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null<br />
AppDomainName : DefaultDomain<br />
ThreadIdentity : <br />
WindowsIdentity : XXXXXXXXXXX<br />
Inner Exception<br />
---------------<br />
Type : System.TypeInitializationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br />
Message : The type initializer for 'Microsoft.ApplicationBlocks.Cache.CacheManager' threw an exception.<br />
Source : Microsoft.ApplicationBlocks.Cache<br />
Help link : <br />
TypeName : Microsoft.ApplicationBlocks.Cache.CacheManager<br />
Data : System.Collections.ListDictionaryInternal<br />
TargetSite : Microsoft.ApplicationBlocks.Cache.CacheManager GetCacheManager()<br />
Stack Trace : at Microsoft.ApplicationBlocks.Cache.CacheManager.GetCacheManager()<br />
at Microsoft.ApplicationBlocks.SmartClient.Offline.OfflineBlockBuilder..ctor()<br />
at Microsoft.ApplicationBlocks.SmartClient.Offline.OfflineBlockBuilder.get_Instance()<br />
at BI2ActiveSalesClient.Infrastructure.ConnectionModule.Services.ConnectionManager..ctor()<br />
<br />
Inner Exception<br />
---------------<br />
Type : System.TypeInitializationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br />
Message : The type initializer for 'Microsoft.ApplicationBlocks.Cache.CacheService' threw an exception.<br />
Source : Microsoft.ApplicationBlocks.Cache<br />
Help link : <br />
TypeName : Microsoft.ApplicationBlocks.Cache.CacheService<br />
Data : System.Collections.ListDictionaryInternal<br />
TargetSite : Microsoft.ApplicationBlocks.Cache.CacheService GetCacheService()<br />
Stack Trace : at Microsoft.ApplicationBlocks.Cache.CacheService.GetCacheService()<br />
at Microsoft.ApplicationBlocks.Cache.CacheManager..ctor()<br />
at Microsoft.ApplicationBlocks.Cache.CacheManager..cctor()<br />
<br />
Inner Exception<br />
---------------<br />
Type : System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br />
Message : The XML configuration document is invalid, the ScavengingInfo section defines a type (assembly: 'Microsoft.ApplicationBlocks.Cache', type 'Microsoft.ApplicationBlocks.Cache.Scavenging.LruScavenging') which an instance can't be created.<br />
Source : Microsoft.ApplicationBlocks.Cache<br />
Help link : <br />
Data : System.Collections.ListDictionaryInternal<br />
TargetSite : Microsoft.ApplicationBlocks.Cache.IScavengingAlgorithm CreateInstance(Microsoft.ApplicationBlocks.Cache.CacheService, Microsoft.ApplicationBlocks.Cache.ICacheStorage, Microsoft.ApplicationBlocks.Cache.ICacheMetadata)<br />
Stack Trace : at Microsoft.ApplicationBlocks.Cache.ScavengingInfo.CreateInstance(CacheService cacheService, ICacheStorage cacheStorage, ICacheMetadata cacheMetadata)<br />
at Microsoft.ApplicationBlocks.Cache.CacheService..ctor()<br />
at Microsoft.ApplicationBlocks.Cache.CacheService..cctor()<br />
<br />
Inner Exception<br />
---------------<br />
Type : System.ArgumentNullException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br />
Message : The cache storage cannot be null.<br />
Parameter name: cacheStorage<br />
Source : Microsoft.ApplicationBlocks.Cache<br />
Help link : <br />
ParamName : cacheStorage<br />
Data : System.Collections.ListDictionaryInternal<br />
TargetSite : Void Microsoft.ApplicationBlocks.Cache.IScavengingAlgorithm.Init(Microsoft.ApplicationBlocks.Cache.CacheService, Microsoft.ApplicationBlocks.Cache.ICacheStorage, Microsoft.ApplicationBlocks.Cache.ICacheMetadata, System.Xml.XmlNode)<br />
Stack Trace : at Microsoft.ApplicationBlocks.Cache.Scavenging.LruScavenging.Microsoft.ApplicationBlocks.Cache.IScavengingAlgorithm.Init(CacheService cachingService, ICacheStorage cacheStorage, ICacheMetadata cacheMetadata, XmlNode configSection)<br />
at Microsoft.ApplicationBlocks.Cache.ScavengingInfo.CreateInstance(CacheService cacheService, ICacheStorage cacheStorage, ICacheMetadata cacheMetadata)<br />
Thanks in advance
Søren
|
|
|
|
|
Hi,
I created Tic-Tac-Toe game. Hope you might have aware of it. Now, two players can play the game in single system.
I would like to make the game as two players can play in their own systems. Ex,
Player1 plays in System1 and
Player2 plays in System2.
Suppose player1 clicks on first cell, the same move should reflect in system2, dynamically.
Next turn goes to Player2. whenever player2 click on one cell out of nine cells, that should reflect in System1.
Hope you understood. Please guide me how can I synchronise both systems.
Thanks and Regards,
Lalitha
|
|
|
|
|
|
Thanks alot Jaans. I downloaded the code from the site given by you. When I made exe to the solution, its working very fine. But, I am unable to debug the code. Whenever I try to connect to other player's system, it is giving the following exception at both client and server side.
"An error occurred: Cross-thread operation not valid: Control 'stbMessage' accessed from a thread other than the thread it was created on."
Please guide me to debug the code.
|
|
|
|
|
hi
iam want to do paging in datalist.i found the code and it is working properly.but the actual problem is iam using master page concept in my application and if i use paging inside master page it is not working.also i want to mimic the page information in the footer as
"page1 to 6 of10"..
can anyone lend me hand.
thanks in advance.
pintoo
|
|
|
|
|
Try the following method.
Place a contentplaceholder in the master page footer area.
<div id="footer">
<asp:ContentPlaceHolder ID="cphFooter" runat="server" />
<!-- asp:Menu Let this be the existing controls ></asp:Menu -->
</div>
In your datalist page use this content place holder (Other pages you can ignore it.)
<asp:Content ContentPlaceHolderID="cphFooter" ID="ctPager" runat="server">
<asp:Label ID="lblPager" runat="server"></asp:Label>
</asp:Content>
You can set the value of the pager as required
lblPager.Text = "Page 1 to 6 of 10";
*jaans
|
|
|
|
|
Hi all,
I want to write a Windows Service using C#. I want to execute the following function after a specified time.
private void ServerStat(object state)
{
const string appName = "groupserver.exe";
RegistryKey rKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Nqual\\Common");
try
{
string appPath = rKey.GetValue("serverLocation").ToString() + "bin\\";
ProcessStartInfo ps = new ProcessStartInfo(appPath + appName);
ps.UseShellExecute = true;
ps.WorkingDirectory = appPath;
System.Diagnostics.Process.Start(ps);
}
catch(Win32Exception ex)
{
Console.WriteLine(ex.Message);
}
}
Edit the OnStart() as follows.
protected override void OnStart(string[] args)
{
TimerCallback timerDelegate = new TimerCallback(ServerStat);
serviceTimer = new Timer(timerDelegate, null, 5000, 5000);
}
Install the service and start the service. But my function not execute. Where I'm going wrong. Help really appreciate. Thanks.
I appreciate your help all the time...
Eranga
|
|
|
|
|
My guess is that your Timer will execute but run to the Exception (the normal service-accounts are not allowed to write in the Registry.
Try running your service in an account with administrator rights on the machine.
BTW: Console.WriteLine is rather useless in a windows-service - but you've got an eventlog for free (look for this.Eventlog) - so why don't you use it?
|
|
|
|
|
Thanks for the replay,
Actually I want to execute an application(*.exe) through windows service. I've just read the registry to find that application and execute it.
Seems my timer gives a problem.
I'm not clear what you say, as alternative for my project. Actually my application(a server application) completely write using C++. Can you please explain it more.
I appreciate your help all the time...
Eranga
|
|
|
|
|
He's saying writing to the console is useless for a service. You should instead write to a file, or better, the system log.
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.
|
|
|
|
|
In your first post you wrote you are using C# (and indeed your code states the same) - so I assume you are not used to C++. In this case you can forget my comment about pointers and co.
|
|
|
|
|
Thanks for all replay.
Actually I've done the job perfectly. Used
ElapsedEventHandler() in
Timer to execute my required function. It works.
Thanks again.
I appreciate your help all the time...
Eranga
|
|
|
|
|
hi
ho can i make my own controls in c# ?
thanks
|
|
|
|
|
hey its simple
start the Visual studio
go for new project
select windows control library
drag and drop the controls (set of controls as u like such as a login form)
run the application
now u can see that a dll is created ( this is ur new control)
now using it just add that dll to ur toolbox and start working ......
regards
sindhu tiwari
its me sid
|
|
|
|
|
You may either use multiple controls to create a custom control (Windows Control Library project), or you may inherit any control and extend its functionality (Class Library project).
Apart from this you may also write a control from the scratch using System.ComponentModel class; however this would be toughest way to do this.
In case if you are planning to create a complex control, it is advisable to check some book related to control creation or use google and check some available samples of custom controls. This would give you more clear idea about the whole process.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hi,
I am doing socket programing in that i am using
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1);
I have found info abt setting the keepalive time
1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following key in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings
3. On the Edit menu, point to New, and then click DWORD Value.
4. Type KeepAliveTimeout, and then press ENTER.
5. On the Edit menu, click Modify.
6. Type the appropriate time-out value (in milliseconds), and then click OK. For example, to set the time-out value to two minutes, type 120000.
7. Restart Internet Explorer.
This is working but its taking more time ...i mean i have set it to 5 minutes and the socket got closed after 20 minutes
so if anyone knows how to set the proper time then plz do let me know
regards
sindhu tiwari
innovative
modified on Tuesday, February 05, 2008 3:48:36 AM
|
|
|
|
|
Hello Friends,
I am developing an windows application in C#.NET and i am using text file to store some predefined responses. Now i want to avoid duplicate entries in text file i am able to achieve some some sort of success in doing that but not fully..
Suppose there is already a sentence in text file
:--- Hello how may i assist you?
now when i enter it again in same format then i get the response duplicate entry that right..
but when i change in case suppose i use
:-- hello how may i assist you?
it get saved in text file i want whenever the string is available in text file whether in UpperCase Or LowerCase it should not save in text file..
|
|
|
|
|
You need to build a dictionary of strings to strings. The key string is all lower case, with spaces and punctuation removed. This means you can't have duplicate entries, then you store the values in the collection, which remain nicely formatted.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
WOW!!
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Hello!
For that, use case for comparison i.e. change the strings to lower-case/upper-case before comparing both. You can use String.ToLower or String.ToUpper for that.
Hope that will be of some help!
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|