Is there some reason why you don't just call BitBlt from VB?
Declare it from the GDI library and use it directly.
(Check the API viewer for the definitions)
IMOH, the database isnt the best place for string manipulation, especially from a performance point of view."
Customer has a database where 24000 addresses have been loaded all in upper case, and wants them changing to Proper case.
How would you personally go about this?
I can't find a string function in TSQL to convert strings to Proper case.
(Found UPPER and LOWER)
In Access , I use STRCONV
Does anyone have a ready rolled function, or a sloution I have missed?
>> i m displaying one record at a time, ... and can easily navigate through it, like grs.movenext, grs.moveprevious etc...
Where as if i select one record only ..i will have to almost rewrite my code...
<<
Almost.
Write a class that has MoveNext, MovePrevious etc functionality, then you call...
...know in advance how many rows I'll get.
Want to process the results row by row, with a progressbar.
The math on the bar is basic:
thisrow/totalrows * 100
But the totalrows thing is where I got stuck without th rowcount.
(Oddly, when I tried the execute scalar solution above, the resulting...
in general terms, if the controls are not data bound, then your 'insert' button clears the screen.
the user types their info.
then they either click SAVE or CANCEL
Save does an insert into the database, then 'moves' to the saved record, so that subsequent on screen changes affect the record you...
Thanks all.
I had those possible workarounds in my back pocket, but was hoping to avoid doing the 'double execute' method because of time overheads.
Maybe the dataadaptor is the way to go, I just get wary about having a 'full table object in memory'.
What a waste..
There is probably some simple answer to this, but as a newbie I was surprised to find that the SQLdatareader class presents a .HasRows property but does not tell you how many to expect.
No .RowCount?
As a no-brainer workaround, I imagined I could read through the records and then start again...
My experience is that you should never attempt to have a VB program as the AUTORUN program on a CD.
VB programs rely upon the VB/OLE runtimes, and sometimes the presence of specific OCXs.
If the target machine has not had VB or a VB6 app installed, your START.EXE program will not run.
Out of...
Well that's exciting. DataReader is a new one on me.
I assume the reader goes out of scope and closes/disposes of itself at the end of the function.
"While (reader.Read())" is pretty cool.
Hiyall..
I'm just getting started with c#, and as a get-me-running project I want to just open a database connection, select a field from an ad-hoc bit of SQL, and iterate through the results.
Most examples I have seen are huge - does anyone have a 20 liner example of this sort of thing?
I...
>>>The result is -3.5527136788005E-15.<<<
A very very small number.
This is the different between storing things as integers and string them as doubles.
-0.0000000000000035527136788005 is pretty close to zero, and that is how you should compare doubles.
eg
if abs(dblInches - intInches) <...
I recently did some work in T-SQL
It has a CONVERT function that allows you to pass string-y dates and convert them to real dates, and vice versa.
The reason I mention this is that it allows you to specify what the format of the string you supply actually is.
The beauty of this is that the...
Check that you dont have any explicit SetFocus commands in there. I have seen this kind of behaviour when validation code keeps playing 'focus tennis' between input controls.
You aren't using error trapping correctly.
On the Set.... line, an error is raised because there is no Excel running.
However, you are not 'handling' the error, which is why Access stops dead.
Instead, you need an 'on error' construct, like this:
On Error GoTo errtrap
Set...
A likely cause is that the instance of the class in the second situation is a completely new object.
eg in Form1:
dim x as new class1
x.property = 24
in Form2:
dim x as new class1
msgbox x.property
gets you 0, because it is a different object.
Try making your object global, or a public...
Wont you just be using a for...next loop to handle this stuff?
MyString = Split(Tmp$, ",")
y = Ubound(MyString) + 1
for x = 0 to y
'do the first five fields if present
if x <= 5
strValue(i, x) = Trim(MyString(x))
end if
select case x
case 12
'handle MEAS-VALUE
case 14...
I see this has moved away from 'week number' now, to 'what is actually required'.
But in case anyone starts looking here to find a 'week number' solution, I'll contribute this now 'off topic' reply:
(Assuming we ignore questions like:
Does the year start on 1 Jan or the first Monday/Sunday of...
No problem.
Put the 30 file names into an array like so:
Dim szFiles(30) as string
szFiles(1) = "C:\bar1.txt"
szFiles(2) = "C:\fred3.txt"
...etc
Wrap the code you are using in a for...next loop
Dim iLoop as integer
For iLoop = 1 to 30
...existing code
Next
Change the lines that...
When it leaves the loop, what is the value of EOF(1)?
It should stay in the loop until it reaches the last row.
What is the value of the second header?
have you in fact reached the end of the file and gotten a blank row? That would 'seem' to be a header by virtue of not beginning with a '1'...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.