|
This is a really weak question but I have hit a brick wall. Bear in mind I have been playing with c# approx 6 wks.
I am writing a project and would like to link a dataset to a sql database. I would like to use the northwind database supplied as default.
I am sat in form1 and I open the toolbox. I scroll down to the data section. There are no sql controls there. I get pointer, dataset, datagrid, binding source, binding navigator, and report viewer but nothing else. I expect the sql stuff (eg. sqladapter) to be there by default.
Do I need to enable anything to see the sql controls? I am using VS2005 BTW.
|
|
|
|
|
all you need to do is reference the namespace
using System.Data.SqlClient; at the top of your form. I would also recommend using SqlDataAdapter to fill your DataSet.
More Info:[^]
Hope this helps.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
got it. Toolbox->right click->choose items and then follow your nose.
|
|
|
|
|
Link to the thread that is already active, instead of re-posting the same question everywhere.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
This should be easy, but for some reasion it has me stumped.
I have a combobox containing only a few items (set at design time). I want the first item to show up by default. How do I do this?
David Wilkes
|
|
|
|
|
At run time, do something like...
MyComboBox.Item[x].Selected = true;. It may be MyComboBox.Item[x].Select();, I can't quite remember. That probably isn't the most elagant way but it works.
Cheers
Jacob.
|
|
|
|
|
Hi,
In my solution , i put a break point and it is getting hit. But, when i press F10 or F11 unable to continue further, just ending the debug with error :
The program '[5892] AdminLoader.exe: Managed' has exited with code -532459699 (0xe0434f4d).
I tried looking at all settings and dignostic attributes but everything is fine.
Any Ideas?
kumar
|
|
|
|
|
it is better if you can give the line where it is crashing.
"Change is the only constant thing in life
Either or survive or get extinct"
|
|
|
|
|
also use try..catch
"Change is the only constant thing in life
Either or survive or get extinct"
|
|
|
|
|
I'm trying to validate a string, ie alpha, numerics and some special characters
I'm using something like this
public bool IsAlphaNumeric(String strToCheck)
{
Regex objAlphaNumericPattern = new Regex("[^a-zA-Z0-9.,-]");
return !objAlphaNumericPattern.IsMatch(strToCheck);
}
but when I want to include whitespace (line break etc) using \s,
the page page breaks and tells me there is a 'Unrecognized escape sequence',
I have tried adding @ sign and 'RegexOptions.IgnorePatternWhitespace' which in theory should do the trick, but does nothing. What do I need to do to make this work.
Kwai
|
|
|
|
|
\\s
---
b { font-weight: normal; }
|
|
|
|
|
i've tried '\\s' already - it compiles okay but when I call the class it returns this error
'parsing "[^a-zA-Z'.,-\s]" - Cannot include class \s in character range.'
kwai
|
|
|
|
|
Try changing position for '\s' class. Something like: [^a-zA-Z\s'.,-]
|
|
|
|
|
A U.S. user reported that when they set a custom short time pattern in regional settings to a 24 hour clock it doesn't display that way in my app.
I use the System.Globalization.CultureInfo.CurrentCulture method to set format for date and time in my app and it works properly for any culture to date.
So I test it out and sure enough, currentculture's ShortDatePattern correctly retrieves a users customized short date, but ShortDatePattern always uses the same format which I guess is the default for the culture which is a 12 hour clock and am pm designation.
This is .net 2.0 by the way.
To test this out yourself:
CultureInfo c = System.Threading.Thread.CurrentThread.CurrentUICulture;
c.ShortDatePattern will always equal whatever was set or overriden in the control panel regional settings, but c.ShortTimePattern will always equal the culture default.
I'm stumped, is this a bug? Is there a workaround? I've searched high and low and found nothing.
|
|
|
|
|
Ahh! Not a bug, an inconsistency. It's amazing how often I seem to find the answer after posting here, despite searching for an hour before that all over the net.
It appears that since the regional settings custom time format has only one box to set a custom time format in (i.e. there is no Long time format or Short time format, only Time format) that .net provides this value in the CurrentCulture CultureInfo objects LongTimePattern property and the ShortTimePattern property defaults to the culture's default setting and is not overriden by the control panel setting.
|
|
|
|
|
So, is it? I heard C# is the evolution of C++ somewhere. I cant seem to find my answer anywhere. Thanks for the help, I'm new to these forums and coding.
|
|
|
|
|
Not really. Bjarne Stroustrup, the creator of the C++ language, recently said that C++ is the the grandparent of C#, in that Java is the parent of C#, and Java's parent is C++.
Java evolved from C++ in that it is a simpler, less powerful but less complex version of C++. C# is closer to C++ than Java, ironically, due to its ability to use pointers, output parameters, and delegates (similar to C's function pointers), whereas Java cannot do those things.
However, C# is not more advanced than C++. Like Java, C# is far less powerful and less complex than C++. All 3 languages really target different areas of software development, comparing them is really apples and oranges once you get beyond their ancestory.
|
|
|
|
|
|
Of course C# is evolution of C++, but C++ is one of the greatest programme language.
=========================================
中国,昆明
|
|
|
|
|
C# is an evolution from several previous languages. Quite a bit Java, lots of C++ and some Pascal, mostly.
In some ways C# is more advanced than C++. The memory management for example is more advanced. It's much more efficient, but also less predictable. It's better for most purposes, but there is still a few applications where you rather want the simple, straight forward, predictable memory management of C++ instead.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
|
It seems you're using the index of the user in the ArrayList as an access key. You may be better off just storing a reference to the user. That way, you can use any type of collection (although an ArrayList is quite suitable) to store the users.
/ravi
|
|
|
|
|
|
Instead of keeping track of an int that's the index into the ArrayList , just keep track of the object (presumably a User ) that you added to the ArrayList . That way you can check if the user is still connected by using Contains() rather than accessing an index that may be invalid.
/ravi
|
|
|
|
|
Oh... So like, assign a user some kind of unique ID or something and pass that to my overridden Contains() ? Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|