|
thank you again....it works!
Ps: sorry but you how would have expressed my question? (better?)
|
|
|
|
|
"How can I get my code to pause or sleep for as long as I want, and resume at the point it 'fell asleep'?"
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello
i new to vb.net and i need help with the compling of a project
i press F5 and this should run the project rite?
i got a message saying that im not in the "Debugging Users" group
it just ask me to add myself to this group which i have no idea what is it
can anyone help me?
i cant seen to start my project
thank you in advance
Gary
|
|
|
|
|
Start your Computer Management Console (Start -> All Programs -> Administrative Tools -> Computer Management)
Navigate to Users in the Console ( System Tools -> Local Users and Groups -> Users) and select your user name. Right-click on it, select properties, then select the "member of" tab, and Add the Debugger Users group.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
hii nick
thank you for your help
but the problem now is that i cant alter anything at the "member of" tab
it just pop out a message saying "The following error accur while saving....."
"Access is denied"
i have follow your instruction
then at the "member of" tab where is empty
i click add then it say select group
im not sure i did it correctly but this is what i did
i select object type and location (currently only 1 is enable for me to choose)
then i press ok...later the error message pop out
did i do anything wrong?
or maybe cause im using my college computer that i require the IT department to do the setting
im asking this cause i will also need it with my personal pc
thank you
Gary
|
|
|
|
|
You will need to be an administratror to change these settings. If you're using your college pc, you might need to ask the administrator of the machine to add the group for you.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
|
Hi,
After I got DateTime from Calendar (ie: fDate = July 04,2004), the date is showed by Debug program is 07/04/2004 but after I using:
strSQL = "SELECT * FROM Invoice WHERE InvoiceDT >= " & fDate>
---> some how it converted fDate back as 04/07/2004 (April 07, 2004) and when execute the SQL I got wrong result!
*) If I get the date later than 12 then there are no problem because MS detects it (ie: 30/06/2004 or 06/30/2004)
1. How can I correct this problem?
2. Do I need special syntax in string SQL for DateTime? (I did try add "#" & fDate "#", the result is the same!)
Many thanks for any help,
Anh
|
|
|
|
|
Your first, and last, mistake is using a concantenated string for an SQL statement.
ALWAYS, ALWAYS, ALWAYS, ... continue for 10 more minutes ..., ALWAYS use PARAMETERIZED queries!
Using a parameterized query will automatically make sure that the date is translated into the appropriate format for the SQL statement. Also, the reverse is true. Any date that is returned will be converted back to the appropriate format for your code.
This is an example from a project I am working on:
Try
oConnection = GetDatabaseConnection()
oCommand = New SqlCommand
oCommand.Connection = oConnection
oCommand.CommandText = "SecurityValidateLogin"
oCommand.CommandType = CommandType.StoredProcedure
Dim sqlParam As New SqlParameter("@Username", SqlDbType.NVarChar, 50)
sqlParam.Value = sUserName
oCommand.Parameters.Add(sqlParam)
sqlParam = New SqlParameter("@Password", SqlDbType.NVarChar, 15)
sqlParam.Value = sPassword
oCommand.Parameters.Add(sqlParam)
sqlParam = New SqlParameter("@SourceIP", SqlDbType.NVarChar, 32)
sqlParam.Value = sSourceIP
oCommand.Parameters.Add(sqlParam)
oConnection.Open()
oCommand.ExecuteNonQuery()
oConnection.Close()
' code removed
Catch ex As Exception
LogErrorEvent("SecurityServices", "ValidateUserLogin", ex.Message, ex.StackTrace)
Throw ex
Finally
' Trash our open objects
If Not oCommand Is Nothing Then
oCommand.Dispose()
End If
If Not oConnection Is Nothing Then
If Not oConnection.State = ConnectionState.Closed Then
oConnection.Close()
End If
oConnection.Dispose()
End If
End Try
Return retValidateValue
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey Dave,
Under what circumstances should we be using parameterized queries?
Charlie
if(!curlies){ return; }
|
|
|
|
|
all, alL, aLL, ALL OF THEM I SAY! MUAHAHAHHAHAH!!
But seriously, for those who read the posts long after we put them up (yeah, right )...
If you have an SQL stored proecdure or statement with a WHERE clause in it, always use parameterized queries to call it! It will save you a bunch of headaches like the original poster had. It's not hard to do, maybe a little tedious, and it's very easy to follow compared to some of the monsterous string built queries I've seen.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello Dave,
- Thank you for your advice, they are looking very clear ... except that I could not find the right SQLparameter for DateTime format (OLEDBparameters and in your example). We do not want to use them as CString!
- I did find out why I had the problem before, because I set the Region & Language setting in English (Canada) DateTime: Day/Month/Year instead of English USA DateTime: Month/Day/Year ... meanwhile My.mdb set Month/Day/Year! After I change, it works OK now!
*) However, your suggestion (if I can find the way) is more dynamic & appropriate because we do not need to re-set the Region & Language setting
---> If you know how to set SQLparameter more precisely, I will appreciate a lot
Hint: In VC++, we force CASTING DateTime variable to float, then we do not worry about which order the DateTime variable is!
strSQL.Format ("SELECT * FROM Table WHERE Date > %f", (float)fDate;)
Thanks,
|
|
|
|
|
You didn't say it was an Access database, but the idea is identical to an SQL Server version. This is an example based on the query you supplied in your first post:
Public Shared Function GetOleDBDataReader(ByVal searchDate As Date) As OleDbDataReader
Dim oleConnection As New OleDbConnection("connectionString")
Dim oleCommand As New OleDbCommand("storedProcedureName", oleConnection)
oleCommand.CommandType = CommandType.StoredProcedure
' or you could use this if the SQL statemnet is not in a stored procedure:
'Dim oleCommand As New OleDbCommand
'oleCommand.CommandText = "SELECT * FROM Invoice WHERE InvoiceDT >= ?"
'oleCommand.CommandType = CommandType.Text
'oleCommand.Connection = oleConnection
' OleDbType depends on the column definition in the database.
' Using this method, you don't have to worry about the proper date format.
Dim sqlDateParam As New OleDbParameter("@DateToSearchFor", OleDbType.Date)
sqlDateParam.Value = searchDate
sqlDateParam.Direction = ParameterDirection.Output
oleCommand.Parameters.Add(sqlDateParam)
oleConnection.Open()
Return oleCommand.ExecuteReader(CommandBehavior.CloseConnection)
End Function
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi everyone.
I'm just asking, what is the better way to connectig to Oracle 8i DB. I know if I using OLE provider for oracle, ok.. Works fine..
But you know other way to fastes execute SQL statments. I looking for the efficient code for searching.
If anyone?
Thanks
Johnny Lizardo
|
|
|
|
|
Check out the System.Data.OracleClient namespace. It'll have everything you need...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a Garmin GPS that I would like to communicate with via
a serial connection. I have downloaded the interface documentation.
The documentation indicates the communication packet has a checksum byte
that is the "2's complement Sum of all data before the checksum byte.
When I add up all of the bytes before the checksum I get a value that
is larger than an 8 bit byte. My final value is 270
If I understand correctly. I take the value of 270 and invert it
Then I add 1 to this value to get the 2's complement.
Example:
Value = 270
Original Value in bits
00000001 00001110 = 270
Value = Not Value
Inverted Value (1's complement)
11111110 11110001 = -271
Value = Value + 1
add 1 to value to get 2's complement
11111110 11110010 = -270
At this point I need to place this into a single 8 bit Byte
I assume I just drop the first 8 bits
to give me the following.
11110010 = 242
My two questions are
1) am I correct in striping off the left 8 bits?
2) how do I do this in VB.Net without having to create a bitarray and manually
processing the bits?
=================================
When I was in school, all I wanted was to get out into the real world.
Now that I'm in the real world, all I want is to go back to school.
|
|
|
|
|
can this be done? None of the books that I have available seem to address this question. It would make things a lot easier if I can hide certain items to eliminate having to perform another query. Thanks
|
|
|
|
|
There are a couple of ways to do this,
1. Set the column width to 0
2. Use datagridtablestyle and datacolumnstyle. Set a mapping to each column you want to show.
HTH
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
after trying that using the gui it seems that the styles that I create don't have any effect on the columns that set them to. I found some code that is doing basically doing everything within that the gui setup should, and it works, but I am unsure why the gui setup doesn't work.
|
|
|
|
|
*shrugs*
bug maybe?
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
How do i do a simple program using VB.Net to convert a particular table's column's datatype in Ms Access?
EG. Column Name Old Data Type New Data Type
Name Text Memo
Help!!!
|
|
|
|
|
Haha, that isn't going to be a simple program! You need to use DAO, research the Object Model...and good luck!
|
|
|
|
|
Hi,
I want to deploy my VB.net application and have been reading about deployment at MSDN. But I cannot find out what I can do with my problem.
I have an application that functions as a shell around other applications such as Excel, Solidworks etc. After building the project there are a lot of dlls in the bin catalog many who have to do with me upgrading the application from VB 6.0 to .Net. I quess all these files are necessarry for another user to be able to run my application? Is there a way that I can package these together with my .exe? So that the user need only use the .msi installation?
Best regards
Pål Eilertsen
|
|
|
|
|
I guess u are using the deployment project using VS.NET itself. If that is the case, you can include the dependent files in your installation. The option allows you to do so...
There is nothing new under the sun, But there are lots of old things we don't know. - Ambrose Bierce
|
|
|
|
|
Hi,everyone.New in this forum to stay
situation
I have a form with three(3) panes and an array of usercontrols(various labels on it)
question
I need to click on label1 of the control(controls because of the array) with diferent answers deppending on which pane the control is
ej.
mysusercontrol(0) is over panel1. If I click on label1 I want the backcolor to be blue.If a move the mysusercontrol(0) to panel2 then if I click on label1 with the left button I want to change the label1.text and if myusercontrol(0) is on pane3 I want the control to be destroyed.
I can do it for myusercontrol(0) but I want to do it for all the controls of the array(mysuercontrol(1) etc,)
kind regards
|
|
|
|