|
Please help me.
Tell me what is the common name of dialog like yahoo (it allow you type and format characters)?
How can I get dialog like that. I need a dialog allow you type and format characters..
I want to add dialog(Richtextbox) to myApplication form. Thx.
ngh
|
|
|
|
|
Thank you all guys. I have found it at http://www.codeproject.com/cs/miscctrl/richtextboxextended.asp
Thank you author a lot...
ngh
|
|
|
|
|
hello,
I have a little question: Does C# 3 gets delivered together with .net framework 3.0 ? Because I installed .net framework 3.0 RC1 and Orcas but I don't get
C# 3 snippets compiled. If it's not in the .net framework 3.0 package can I download the compiler somewhere else, is it already available?
Thank you.
|
|
|
|
|
|
thank you for the clarification.
|
|
|
|
|
VS 2003
C#: Windows Application - OLEDB Connection -->MS Access
Customer Table --> C Dataset
Product Table --> P Dataset
Customer Product Table --> CP Dataset --> Display Datagrid
----------------------------------------
Hi, I have a form that have textfields from Customer Dataset and Product Dataset. How do I update both data into the CP Dataset and display into Datagrid?
|
|
|
|
|
I have a very simple and short application, which is copy/pasted below. Serialization goes perfectly nice. The XML file is being created and it looks correct.
The problem starts when trying to deserialize -> I get an error:
Code:
There is an error in XML document (1, 1).
---------------------------------
This is the programme:
[Serializable]<br />
<br />
publicclassData<br />
<br />
{<br />
<br />
[XmlArrayItem(typeof(string))]<br />
<br />
publicArrayList Pol = newArrayList();<br />
<br />
[XmlArrayItem(typeof(string))]<br />
<br />
publicArrayList Eng = newArrayList();<br />
<br />
[XmlArrayItem(typeof(string))]<br />
<br />
publicArrayList Ger = newArrayList();<br />
<br />
}
<br />
<br />
[Serializable]<br />
<br />
publicclassStoreHouse<br />
<br />
{<br />
<br />
[XmlArrayItem(typeof(Data))]<br />
<br />
publicArrayList DataList = newArrayList();<br />
<br />
}
Serialization part:
Data d = newData();<br />
<br />
d.Eng.Add("1");<br />
<br />
d.Eng.Add("2");<br />
<br />
d.Ger.Add("dadas");<br />
<br />
d.Ger.Add("dsadsadAS");<br />
<br />
d.Pol.Add("dasd");<br />
<br />
d.Pol.Add("etrre");<br />
<br />
d.Pol.Add("trtre");<br />
<br />
sh.DataList.Add(d);<br />
<br />
Data d1 = newData();<br />
<br />
d1.Eng.Add("1321");<br />
<br />
d1.Eng.Add("2ds");<br />
<br />
d1.Ger.Add("ddadadas");<br />
<br />
d1.Ger.Add("dsa123123dsadAS");<br />
<br />
d1.Pol.Add("das31231dasd");<br />
<br />
d1.Pol.Add("et3213rre");<br />
<br />
d1.Pol.Add("t131rtre");<br />
<br />
sh.DataList.Add(d1);<br />
<br />
XmlSerializer s = newXmlSerializer(typeof(StoreHouse));<br />
<br />
s.Serialize(new System.IO.StreamWriter(@"c:\a.xml"), sh);
Deserialization part:
XmlSerializer s = newXmlSerializer(typeof(StoreHouse));<br />
<br />
sh = ((StoreHouse)s.Deserialize(new System.IO.StringReader(@"c:\a.xml")));
What do you think may be wrong?
thank you very much in advance
|
|
|
|
|
GOOGLE: MSDN C# XmlSerializer "error in XML document"
led mike
|
|
|
|
|
I read many MSDN articles regarding serialization issue. I still can`t see mistake. Can you?
|
|
|
|
|
-Yoyosh- wrote: I read many MSDN articles
I don't care how many you read did you read the "one" that I pointed you to? The first one in the search results using my search? Did you read the section titled "Problems Deserializing XML"?
If you did all that why have you not posted the contents of the InnerException so we can help you?
led mike
|
|
|
|
|
I'd like to use an Async. HttpWebRequest for my application (because, i have a long loop and my GUI seem to freeze) but i have to pass a CookieContainer and retrieve it from each request, how can i do? someone can do an example? i can't find anything on the net with Cookies, thank you
|
|
|
|
|
How to get all processes that comunicate via port 80?
thank you for any help
|
|
|
|
|
|
Is it possible to clear the CurrentCell property so that it doesn't point to anything in the grid at all? I've tried CurrentCell = new DataGridCell(-1,-1) as an analog to the SelectedIndex = -1 used in comboboxes, listboxes, and listviews, but CurrentCell is instead assigned to the existing cell 0,0.
|
|
|
|
|
Can you override inherited delegates? If so, how?
I have a control that inherits from GridView (i.e. myGridView). It has a deleglate to handle some custom stuff.
public PBGridView()
{
RowUpdating += new GridViewUpdateEventHandler( PreUpdate );
}
I have another control that inherits from myGridView (i.e. myMultiGridView). I want to have it's own RowUpdating and skip the inherited one. How do I override it or "remove" it from myMultiGridView?? or do I have to edit myGridView to handle where it's getting called from? I would like to take care of it in myMultiGridView (lowest inherited level).
Thanks, Jessica
|
|
|
|
|
lsugirljte wrote: Can you override inherited delegates? If so, how?
They hide that information in the documentation[^]
The OnRowUpdating method also allows derived classes to handle the event without
attaching a delegate. This is the preferred technique for handling the event in a derived class.
led mike
|
|
|
|
|
Thanks for the help but I'm worried about this part.
"Notes to Inheritors When overriding OnRowUpdating in a derived class, be sure to call the base class's OnRowUpdating method so that registered delegates receive the event. "
I don't want to call the base class's OnRowUpdating method because it has code that won't work with my inherited class.
Thanks, Jessica
|
|
|
|
|
You could try using the new keyword and redefine the event in your myMultiGridView class. For example
class GridView
{
public event RowUpdatingDelegate RowUpdating;
}
class MyMultiGridView : GridView
{
public new event RowUpdatingDelegate RowUpdating;
}
Now clients who subscribe to MyMultiGridView's RowUpdating event will not get notified when the base class fires the event, so you get your own RowUpdating event. Unfortunately, this only works if the client uses your class to subscribe to events. For example
GridView g = new GridView();
g.RowUpdating += ...
MyMultiGridView g = new MyMultiGridView();
g.RowUpdating += ...
|
|
|
|
|
I found that this worked fine.
base.RowUpdating -= new GridViewUpdateEventHandler(base.PreUpdate);
Thanks, Jessica
|
|
|
|
|
I'm converting a 1.1 application to 2.0. There is some heavy use of Hashtable as well as two Hashtable = Hashtable.Synch(new HashTable); Is there a Generics equivalent??? I've not been able to find one.
|
|
|
|
|
I found this on the web a while back:
public class SafeDictionary<TKey, TValue> : IDictionary<TKey, TValue>
{
private readonly object syncRoot = new object();
private Dictionary<TKey, TValue> d = new Dictionary<TKey, TValue>();
#region IDictionary<TKey,TValue> Members
public void Add(TKey key, TValue value)
{
lock (syncRoot)
{
d.Add(key, value);
}
}
public bool ContainsKey(TKey key)
{
return d.ContainsKey(key);
}
public ICollection<TKey> Keys
{
get
{
lock (syncRoot)
{
return d.Keys;
}
}
}
public bool Remove(TKey key)
{
lock (syncRoot)
{
return d.Remove(key);
}
}
public bool TryGetValue(TKey key, out TValue value)
{
lock (syncRoot)
{
return d.TryGetValue(key, out value);
}
}
public ICollection<TValue> Values
{
get
{
lock (syncRoot)
{
return d.Values;
}
}
}
public TValue this[TKey key]
{
get
{
return d[key];
}
set
{
lock (syncRoot)
{
d[key] = value;
}
}
}
#endregion
#region ICollection<KeyValuePair<TKey,TValue>> Members
public void Add(KeyValuePair<TKey, TValue> item)
{
lock (syncRoot)
{
((ICollection<KeyValuePair<TKey, TValue>>)d).Add(item);
}
}
public void Clear()
{
lock (syncRoot)
{
d.Clear();
}
}
public bool Contains(KeyValuePair<TKey, TValue> item)
{
return ((ICollection<KeyValuePair<TKey,
TValue>>)d).Contains(item);
}
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int
arrayIndex)
{
lock (syncRoot)
{
((ICollection<KeyValuePair<TKey, TValue>>)d).CopyTo(array,
arrayIndex);
}
}
public int Count
{
get
{
return d.Count;
}
}
public bool IsReadOnly
{
get { return false; }
}
public bool Remove(KeyValuePair<TKey, TValue> item)
{
lock (syncRoot)
{
return ((ICollection<KeyValuePair<TKey,
TValue>>)d).Remove(item);
}
}
#endregion
#region IEnumerable<KeyValuePair<TKey,TValue>> Members
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
{
return ((ICollection<KeyValuePair<TKey,
TValue>>)d).GetEnumerator();
}
#endregion
#region IEnumerable Members
System.Collections.IEnumerator
System.Collections.IEnumerable.GetEnumerator()
{
return ((System.Collections.IEnumerable)d).GetEnumerator();
}
#endregion
}
|
|
|
|
|
Thanks. I'm not sure if your code is what I ended up with....but I used it as a basis for creating this (comments were pulled to keep my sanity with all of the lt/gt symbols) ::
using System;
using System.Collections.Generic;
using System.Collections;
namespace System.Collections.Generic
{
public class ThreadSafeDictionary<TKey, TValue> : IDictionary<TKey, TValue>
{
private readonly object syncRoot = new object();
private Dictionary<TKey, TValue> d = new Dictionary<TKey, TValue>();
#region IDictionary<TKey,TValue> Members
public void Add( TKey key, TValue value )
{
lock ( syncRoot )
{
d.Add( key, value );
}
}
public bool ContainsKey( TKey key )
{
lock ( syncRoot )
{
return d.ContainsKey( key );
}
}
public ICollection<TKey> Keys
{
get
{
lock ( syncRoot )
{
return d.Keys;
}
}
}
public bool Remove( TKey key )
{
lock ( syncRoot )
{
return d.Remove( key );
}
}
public bool TryGetValue( TKey key, out TValue value )
{
lock ( syncRoot )
{
return d.TryGetValue( key, out value );
}
}
public ICollection<TValue> Values
{
get
{
lock ( syncRoot )
{
return d.Values;
}
}
}
public TValue this[ TKey key ]
{
get
{
lock ( syncRoot )
{
return d[ key ];
}
}
set
{
lock ( syncRoot )
{
d[ key ] = value;
}
}
}
#endregion
#region ICollection<KeyValuePair<TKey,TValue>> Members
public void Add( KeyValuePair<TKey, TValue> item )
{
lock ( syncRoot )
{
if ( d.ContainsKey( item.Key ) )
throw new InvalidOperationException( String.Format( "The item for key {0} already exists in the dictionary.", item.Key ) );
d.Add( item.Key, item.Value );
}
}
public void Clear()
{
lock ( syncRoot )
{
d.Clear();
}
}
public bool Contains( KeyValuePair<TKey, TValue> item )
{
lock ( syncRoot )
{
return ( ( ICollection<KeyValuePair<TKey, TValue>> )d ).Contains( item );
}
}
public void CopyTo( KeyValuePair<TKey, TValue>[] array, int arrayIndex )
{
lock ( syncRoot )
{
( ( ICollection<KeyValuePair<TKey, TValue>> )d ).CopyTo( array, arrayIndex );
}
}
public int Count
{
get { return d.Count; }
}
public bool IsReadOnly
{
get { return false; }
}
public bool Remove( KeyValuePair<TKey, TValue> item )
{
lock ( syncRoot )
{
return ( ( ICollection<KeyValuePair<TKey, TValue>> )d ).Remove( item );
}
}
#endregion
#region IEnumerable<KeyValuePair<TKey,TValue>> Members
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
{
return ( ( IEnumerator<KeyValuePair<TKey, TValue>> )d );
}
#endregion
#region IEnumerable Members
IEnumerator IEnumerable.GetEnumerator()
{
return ( ( System.Collections.IEnumerable )d ).GetEnumerator();
}
#endregion
}
}
|
|
|
|
|
hi
i want to export My DataGridView to an Excel 2003, How to do ??
( I found an article from this site that convert datagrid to excel :
http://www.codeproject.com/csharp/export2excel.asp[^]
but it is datagrid and i want DataGridView .. how to do ??)
thanks
|
|
|
|
|
Hi have a problem with a remoting tool Im making. When you select a computer, it connects and shows data from the server on that end - however, if I close that form, and then try again with a different IP, I get an exception:
System.Runtime.Remoting.RemotingException: the channel 'http' is not registered with remoting services at System.Runtime.Remoting.Channels.ChannelServices.UnregisterChannel(IChannel chnl)
How can I "unregister" my channel and launch a new connection?
Here is my connection at the mo:
public void InitRemoteServer()<br />
{<br />
try<br />
{<br />
RemotingConfiguration.RegisterWellKnownClientType(<br />
typeof(procDLL),<br />
"http://" + connIP + ":" + connPORT + "/procDLL");<br />
}<br />
catch (Exception ex)<br />
{<br />
}<br />
}<br />
<br />
private void viewProcesses_Load(object sender, EventArgs e)<br />
{<br />
HttpChannel channel = new HttpChannel();<br />
ChannelServices.RegisterChannel(channel);<br />
try<br />
{<br />
InitRemoteServer();<br />
}<br />
catch (Exception ex)<br />
{<br />
ChannelServices.UnregisterChannel(channel);<br />
}<br />
server1 = new procDLL();<br />
string allProcsRunning = server1.return_processes();<br />
}
Thanks, Ben.
|
|
|
|
|
You are only showing your init and load logic. What about your close logic?
Are you unregistering and closing your connection when you close???
Check that.
Also....you may want to look into changing your server as a part of you application. Something like File/Change server...
Then close the current server connection and open the new one. If you get that logic working then you know what you must do when you close.
If you shutdown your app without the clean close and run your app again, the channel is still hanging around.
|
|
|
|