|
The generic version of the HashTable is the Dictionary:
Dictionary<string, int> temp = new Dictionary<string, int>();
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
What is the reason for the StackOverFlowException and AccessViolationException
and the solutions for these errors in windows application + C#.net 2.0
|
|
|
|
|
They're pretty self explanatory, but here goes.
tauras81 wrote: StackOverFlowException
This occurs when the stack overflows. There is a limited number of methods that can be called, so the most common occurance of this exception is when you keep calling the same method over and over again. The most common time i see this exception is when I make a case-related typo eg
public class Foo
{
private int bar;
public int Bar
{
get{ return this.Bar; } <-- that should have said this.bar. By being uppercase it will keep calling itself. StackOverflowException will occur
}
}
tauras81 wrote: AccessViolationException
This exception is usually thrown when trying to read or write protected memory. It has to do with unsafe or unmanaged code, and as I dont deal with this very often I cant think of a simple reproducable bit of code to demonstrate it. You could try the documentation[^] - a good place to go in both these cases.
|
|
|
|
|
This error occurs when
--- We have called any function or Property from Itself
When we are calling function it saves current function's state in Stack Memory
But when we call recursively(infinite) then it results in overflow of memory.
Best Regards,
Chetan Patel
|
|
|
|
|
hi there!! I have an issue with the PrintPageEventHandler function. There are two parameters what are coming with the function(object and PrintPageEventArgs), I want to add one more parameter, XmlDocument, but when I am trying to do that, I am receiving an error: No overload for PrintPageEventHandler matches delegate "System.Drawing.Printing.PrintPageEventHandler". Is there anyway how I can put some other parameter for this handler or no? Thx ahead
|
|
|
|
|
Good morning good cpians
DataTable dt = new DataTable("SomeTable");
string[] tokens;
dt.Columns.Add("ID",typeof(int));
dt.Columns.Add("Name",typeof(string));
StreamReader sr = new StreamReader("C:\\SomeFile.csv");
while (!sr.EndOfStream)
{
tokens = sr.ReadLine().Split(',');
if (tokens.Length == 2)
dt.Rows.Add(tokens);
string strExpression = "ID = 1";
DataRow[] dr = dt.Select(strExpression);
MessageBox.Show(dr[0].ToString());
I've been posting this since yesterday and I still need it to be as I wrote it "DataTable is filled out of a file that makes it ambiguous to decide what type the value is" as seen from my example, can you please try it with my exact code and tell me what modification I would need?? Cuz I think the problem is in the way I'm storing data not in filtering it!
ps. I should also be able to apply other operands like < and > and concatenate them with variable values.
Many thanks guys!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Thanks I've done it the other way round
double d_ID = Convert.ToDouble(MyDataRow["ID"].ToString().Trim())
if (d_ID == 0)
MessageBox.Show(d_ID.ToString());
But still interested to know the answer for more complex select statements
Thanks!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
using System.Configuration;
static void ShowConfig()
{
foreach (string key in ConfigurationManager.AppSettings)
{
string value = ConfigurationManager.AppSettings[key];
Console.WriteLine("Key: {0}, Value: {1}", key, value);
}
}
get an error The name'ConfigurationManager' does not exist in the current context.
Can anyone help?
|
|
|
|
|
You need to add reference to System.Configuration
|
|
|
|
|
Another error :Configuration system failed to initialize.
Please help.
|
|
|
|
|
Perhaps the file is malformed.
|
|
|
|
|
Hi, i 've a question about calendar control in visualstudio 2005. I need to use different buttons for next and prev month but NextPrevStyle has only 1 CssClass... how can i do it? thx!!!!
|
|
|
|
|
Axelaser wrote: CssClass
And that means you are in the wrong place. Head off to the ASP.NET forum.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 alpha 4a out now (29 May 2008) ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
how to wright this query
"select * from stock_in where result NOT EQUALS 'YES'"
|
|
|
|
|
Use the <> operator.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
first off your in the wrong forum, try SQL
secondly NEVER SELECT * FROM
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Harvey Saayman wrote: secondly NEVER SELECT * FROM
Unless you have a very good reason - and yes, there are times when you need to do it, but not in your normal run of the mill applications.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: and yes, there are times when you need to do it
like when?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
For example when you have a sub query. In that case the fields are specified in the sub query and doesn't need to be repeated in the query.
select *
from (
select top 10 SomeField, AnotherField
from SomeTable
order by SomeField asc
) x
order by SomeField desc
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
okay that makes sense, cause your just selecting everything returned from the sub query...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
A simple example, when you are extracting a subset of data to a file for any reason.
As I said, not the normal run of the mill applications, and I agree you shouldn't use it normally, but, as they say, never say never
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: when you are extracting a subset of data to a file for any reason
Including when I only want a subset of the columns?
|
|
|
|
|
Not really, I was replying t a cmment that said NEVER use select *
Bob
Ashfield Consultants Ltd
|
|
|
|
|
You realise how legacy the "never select *" rule is right? Back in SQL 7 (circa 1997), it caused an extra round trip to the server to determine the table schema before doing the actual data select. By SQL 2000 they had fixed this issue and it ceased to be a problem.
As far as good practice goes, I totally agree with you. As far as a bolded+uppercase NEVER goes, sorry, you're wrong.
|
|
|
|