|
Perhaps a slightly more efficient way would be to command.ExecuteReader().GetDataTypeName on each column. But I think it would be hardly distinguishable from your FillSchema. I see no reason to change your existing code.
p.s. for large code blocks, next time use <pre> tags instead of <code> tags.
|
|
|
|
|
Thanks for the ingo, Judah. I think part of my problem is that we use a ton of linked servers here and calls made with OpenQuery, which I'm sure affect the call to FillSchema, since many SQL statements are actually in varchar variables, and executed using exec.
Judah Himango wrote: p.s. for large code blocks, next time use <pre> tags instead of <code> tags.
I always forget about that until it's too late. :->
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
Hey got a few problems with an auto popup calendar im trying to get working. Here's the deal.
Asp textbox with an Onfocus command jammed in it. When the textbox is clicked on it succesfully calls the Javascript required to set a div's display property to "block". It was previously set to "none". Ok so that bit works fine and the div appears, sat nicely next to the textbox with the calendar controls inside it.
The problem occurs when you click on the calendar to change the date because, of course, this causes a postback, and alas sets the div's display setting back to none.
How can I prevent this from happening??? I only want the calendar to hide when a date is selected.
If you really need to see the code the site is online here http://www.thepinesbroseley.co.uk/Bookings.aspx[^]
Bigup nuff respect
|
|
|
|
|
Any ideas on what functions I need to use to retrieve a handle from an active window and edit that window (drawing, outputting text, etc..) maybe for a game or other form?
Thanks....
|
|
|
|
|
You cannot achieve this with the .NET framework alone; you'll need to P/Invoke some Win32 API calls to get the device context of another window and begin drawing on that. Thus, I recommend you ask this question in the Visual C++ forum; those guys have a better knowledge of what you'll need to do.
|
|
|
|
|
Hey,
just a quickie, is there an actual difference between Model View Controller, and Model View Presenter?
Or are they just the same thing?
Regards
Mark
|
|
|
|
|
They're not quite the same thing. MVP is a fresh take on the old MVC. Perhaps this article[^] will explain better than I can.
|
|
|
|
|
Thanks for the link Judah, I shall have a read.
|
|
|
|
|
I think the main difference is that in MVP there is a greater seperation of view and model. The view and model are exclusive; they have no knowledge of each other in MVP, whereas that is not the case in MVC.
|
|
|
|
|
|
Hi!
This dont seem to work, any ideas? (Im sure you have lots of ideas, but remember Im a newbie)
label1.Text += ".";
string k = label1.Text;
int r;
r = label1.Text.IndexOf(k);
if (r > 0)
{
MessageBox.Show("bla");
}
so, r is never above 0 despite that the string contains a "."
Newbie untill I die!
|
|
|
|
|
IndexOf returns a 0 based index. "." is not in position 1, it is in position 0. If nothing is found -1 is returned. Your code should be
if( r != -1 )
|
|
|
|
|
hi, and thanks for your fast answer. Im trying to program a calculator and you should not be able to hit "." multiple times in a row. So if I take this code:
string k = label1.Text;
int r;
r = label1.Text.IndexOf(k);
if (r != -1)
{
label1.Text += ".";
MessageBox.Show("bla");
}
And paste in under, for example, the button 9, I still get the msgbox! That should not happend, shouild it? Because now, there are no "." in the string...or Im missing someting here?
Newbie untill I die!
|
|
|
|
|
hristo1977 wrote: string k = label1.Text;
int r;
r = label1.Text.IndexOf(k);
Wait, you take the contents of your textbox (k) and test (IndexOf(k)), if it exists? This will always return the index 0.
What you probably want is IndexOf(".")
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hristo1977 wrote: Im trying to program a calculator and you should not be able to hit "."
Here's a simple way to determine if the period character exists multiple times in a string:
string text = label1.Text;
int periodCount = 0;
foreach(char character in text)
{
if(character == '.')
{
periodCount++;
}
}
if(periodCount > 1)
{
}
|
|
|
|
|
Thanks a lot, Himango!
Newbie untill I die!
|
|
|
|
|
Does anyone know how to insert a line break character within the <summary> or <remarks> section of an xml comment / description associated with a method / property / class so that the printout in intellisense or HTML documentation includes this line break?
Thanks.
|
|
|
|
|
It is just slightly extended XHTML with some additional tags such as "summary", "remarks", "see", "param" etc. Putting paragraphs between <p> & </p> or putting <br/> for simple linebreaks should work.
|
|
|
|
|
funny, I've tried both but neither create a line break in the intellisense helptab. I couldn't recall the codes but you've reminded me and I believe they do work with, e.g., NDoc.
Thanks.
|
|
|
|
|
|
I have a form with a tabcontrol(with 2 tabpages) and I add a new TabControl at runtime using
this->Controls->Add(gcnew TabControl());
Its been created at top left corner of windows and not visible fully..how to control its location/size etc? how to access it?
Thanx in advance
|
|
|
|
|
I think you need to be in the C++ message boards. Anyway, you could do something like:
TabControl* tabCtrl = new TabControl();
this->Controls->Add( tabCtrl );
Now use tabCtrl to get its position etc.
|
|
|
|
|
oops.. wrong section..
I cant do the way u describe...as I have to create some tabcontrols dynamically at runtime but not at design time
|
|
|
|
|
I still do not see why you cannot do that. perhaps a little more code from what you are attempting to do will be useful.
You could do something like.
void MyPage::CreateTabControl() {
TabControl * tab = new TabControl();
Controls->Add( tab );
SizeAndPositionTab( tab ); //Put you size and position code in here
}
Now call CreateTabControl() dynamically from wherever in your code.
|
|
|
|
|
Thanx for ur reply.
But this is applicable to one tab bcos I am going to specify its location.
But at runtime I want to call this function(for eg: 20 times) then I cant see 20 tabcontrols as each one overwrites one another.Hope u understand my problem
|
|
|
|