|
|
hi assaf,
got an error when compiling.
'System.ArgumentException'
in this line
adp = new SqlDataAdapter(cmd);
ds = new DataSet();
dtg.DataSource = ds;
dtg.DataMember = "M_CUSTOMER"; --> got an error here!
adp.Fill(ds);
******************************
I just want to
know everything
|
|
|
|
|
This Exception here mean that the table "M_CUSTOMER" doesn't belong to the dataset "ds"
So verify when you run the program that the dataset contain this table and check his Name
hope that this help you ...
Assaf
|
|
|
|
|
hi,
i am new in c#,how to add values in below Dictionary
private Dictionary<string, Dictionary
<string, double>> batchTable = new
Dictionary<string, Dictionary<string, double>>();
parthiban
|
|
|
|
|
I have two different ways:
private Dictionary<<string, double>> innerTable;
private Dictionary<<string, Dictionary<<string, double>>>> outterTable;
public DataAccessLayer()
{
innerTable = new Dictionary<<string,double>>();
outterTable = new Dictionary<<string, Dictionary<<string, double>>>>();
innerTable.Add( "stringKey", 12312.012 );
outterTable.Add( "anotherStringKey", innerTable );
}
public class UsingMyNewCollections
{
public UsingMyNewCollections()
{
InnerDictionary inner = new InnerDictionary();
inner.Add( "StringKey", 1213.0123D );
OutterDictionary outter = new OutterDictionary();
batchTable.Add( "SomeKeyString", outter );
}
}
public class OutterDictionary : IDictionary<<string, InnerDictionary>>
{
private Dictionary<<string, InnerDictionary>> m_outterDictionary;
public OutterDictionary()
{
m_outterDictionary = new Dictionary<<string, InnerDictionary>>();
}
public void Add( string key, InnerDictionary value )
{
m_outterDictionary.Add( key, value );
}
#region IDictionary<<string,MyTable>> Members
#endregion
#region ICollection<<KeyValuePair<<string,MyTable>>>> Members
#endregion
#region IEnumerable<<KeyValuePair<<string,MyTable>>>> Members
#endregion
#region IEnumerable Members
#endregion
}
public class InnerDictionary : IDictionary<<string, double>>
{
private Dictionary<<string, double>> m_innerDictionary;
public InnerDictionary()
{
m_innerDictionary = new Dictionary<<string, double>>();
}
public void Add( string key, double value )
{
m_innerDictionary.Add( key, value );
}
#region IDictionary<<string,double>> Members
#endregion
#region ICollection<<KeyValuePair<<string,double>>>> Members
#endregion
#region IEnumerable<<KeyValuePair<<string,double>>>> Members
#endregion
#region IEnumerable Members
#endregion
}
MSDN on using the DictionaryBase.Dictionary[^]
I'm listening but I only speak GEEK.
|
|
|
|
|
hi i am student.im doing research about development of adaptive digital notch filter for the removal of 50Hz power line noise in ECG.i have a sample of 50Hz noise of ECG..now i need to call the file in mathlab..how must i do it?im very new to mathlab..please help me..
|
|
|
|
|
I think u have accidently landed up in the wrong place, you may try out the Hardware section for your query, u are most likely to find the right solution there. This is C# zone.
|
|
|
|
|
I have
Type propertyType
it can be of any type I want to separate types of Enum type for example
propertyType == typeof(System.Windows.Forms.AutoSizeMode)
or
propertyType == typeof(System.Windows.Forms.BorderStyle)
or
propertyType == typeof(System.Windows.Forms.CharacterCasing)
or
propertyType == typeof(System.Windows.Forms.FlatButtonAppearance)
and many more now I want to separate them from others like
propertyType == typeof(System.Drawing.Image)
can you help me
Thanks and Regards
Amar Chaudhary
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
Are you asking how to detect all enum types without having to check for each specific type individually?
Enums derive from System.Enum - perhaps you could check that instead rather than have to list all enum types.
|
|
|
|
|
Solved
else if (propertyType.IsEnum)
{
result = Enum.Parse(propertyType, value);
}
actually this was my mistake as I was experimenting with
"System.Windows.Forms.Cursor" which is not enum
Thanks and Regards
Amar Chaudhary
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
I update the DataSet but the DataGridView still show me the old Data
This my Code :
adap.SelectCommand = cmd;
ds.Tables.Remove("CreditCardInfo");
adap.Fill(ds, "CreditCardInfo");
dtgCreditInfo.DataSource = ds;
dtgCreditInfo.DataMember = "CreditCardInfo";
dtgCreditInfo.Update();
Please i need help, it's urgent
Thanks so much
Assaf
|
|
|
|
|
I'm sorry Assaf, what exactly u want to do ?
if u want to get the latest data why dont u use datatable.
Regards,
Tomi
|
|
|
|
|
I have alredy the data in the dataset,
the data i want to display in the datagridview i have it but the datagridview still show me the old data
"You mean to fill the datatable from the adap and reuse instead of the dataset?"
Thanks a lot
-- modified at 1:32 Monday 10th September, 2007
Assaf
|
|
|
|
|
Yes, if u want to show the latest data then u should use datatable instead dataset
For Example :
<br />
string conect = ConfigurationManager.ConnectionStrings["CON"].ToString();<br />
SqlConnection conn = new SqlConnection(conect);<br />
SqlDataAdapter da = new SqlDataAdapter ("Select * From MyTable",conn);<br />
DataTable dt = new DataTable();<br />
da.Fill(dt);<br />
Hope this can help solve u'r problems
-- modified at 2:01 Monday 10th September, 2007
Regards,
Tomi
|
|
|
|
|
hi friend's
i need to define an array of bit bezause i want to define an array with 2,000,000 cells and i have not enough memory to do it. so i need to define an array of bit or something similar it.
thank you for your guide...
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
Have a look at BitArray
my first google result: Some BitArray example
Good luck,
Jelle Hissink
-- modified at 18:53 Sunday 9th September, 2007
|
|
|
|
|
|
If the bit array doesn't fit and you only need the on/off representation, you can use some long ints and iterate over them. I've done that for some forms where the user had dozens of checked/unchecked options to select.
--
i
|
|
|
|
|
I made a simple configuration class to store program settings. My reason for this was to make the form application more portable (no HDD installation required), able to run on removable drives (e.g., USB), and did not write information to the user's profile or the registry. The answer was obviously a binary data file.
My first test was serialize/deserialize my properties using BinaryFormatter in a serializable class. Although I could have used XML serialization, I chose the binary file route versus text.
The test second option was to simply read and write the properties using BinaryReader and BinaryWriter.
The resulting output file (I call settings.bin) is about 1,000 bytes larger with the serialization technique then with the BinaryWriter option.
My question is; are there any performance differences between the two?
Thanks,
Mark
|
|
|
|
|
Mark,
BinaryReader/Writer should be much faster, however as you are using it only on a small settings file that will propably only be read at startup and saved only when the user changes something. The BinaryFormatter should be fine.
However writing your own file format is somewhat additional work, it simplify upgrades of your software. The formatter might fail when you add, change or remove fields in your settings.
Why can't you use System.Configuration do the work for you, it was made to handle settings (stored in .config files so you can put them on your USB stick).
Regards,
Jelle Hissink
|
|
|
|
|
Jelle Hissink wrote: Why can't you use System.Configuration do the work for you, it was made to handle settings (stored in .config files so you can put them on your USB stick).
Because the settings files are written to the user's "%UserName%\Application Data\Program_Name\" folder, and these are also XML (text) files. The binary disk file, is in the same folder as the application and is always available. So, if I move the application to another PC my settings are there too.
This obviously wouldn't work with registered DLL's and other support files that would require a hard disk install.
Mark
|
|
|
|
|
|
I'm trying to recieve information from my MIDI keyboard, a Casio CTK-800, to be exact. It connects to the computer via USB. So, what I need to know is...
1. How can I find out which keys are being pressed down?
2. Is it possible to play sounds through the MIDI keyboard's speakers (as in, not midi sounds, sounds like vocals)?
3. Is it possible to recieve input from the microphone connected to the computer?
Help would be much appreciated. Thanks!
Hippophobia - Fear of horses. What?
|
|
|
|
|
The very first search result for MIDI keyboard c# returns this result[^]
Why don't you use search?
|
|
|
|
|
I tried searching, but couldn't find anything... Guess I was typing the wrong words! Thanks for the help, anyway.
Hippophobia - Fear of horses. What?
|
|
|
|