|
But.. My name is not Gary
My (first)name is Florent
|
|
|
|
|
ooooppppps...I'm so sorry. I'm referring to wrong message
|
|
|
|
|
Hi !
I was doing little investigations on the With ... End With block. I read on the web that using a With block may give you a little performance boost.
I tried to compare what is generated when you use with or not. And what surprised me is that there are no difference at all ! the IL is the same whether you use with or not.
Is everybody wrong when they say that it is faster with with block ? Or was it true with VB6, and not VB.NET ?
|
|
|
|
|
No, they're not wrong, but it must be taken in the proper context. Using With was a performance boost in VB6, but not in VB.NET. This is because of the optimizations the VB.NET compiler can perform as opposed to the VB6 compiler. The With block in VB.NET no longer offers this performance boost, but exists soley for backward compatibility and code readability.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, this is what I thought. I'll continue then to use With block when it may improve code readability.
|
|
|
|
|
i have 2 forms and an object (WMPLib.WindowsMediaPlayer()), how can i access the object's members and form's members, throughout each other?
yes, i did see the post from not too long ago about passing data between multiple forms.. i tried using shared, public, the 'module' method described.. cant seem to get it to work.
any input appreciated, thank you.
------------------------
Jordan.
III
|
|
|
|
|
i think i got it to work, with help from this article
------------------------
Jordan.
III
|
|
|
|
|
i recently created a file in C:\ using system.IO.FileStream and was told that if i want a datagrid to save and load automatically when the program is closed and opened I would have to source it to an object and have the object do so. i am not familiar with objects. what objects should be used. does xml have to be used? the grid is just like a check book register so the user can type in it.its blank except for the column headers. and i want the data the user inputs to be saved and loaded as the program is opened and closed.
your help is greatly appreciated
|
|
|
|
|
If you go back and read the reply post again, you'll find that the "object" your talking about is a DataSet . The docs for which are here[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How do you rotate a picture in an imagebox or picture box by 90degrees
Donald
|
|
|
|
|
Try read the information from here.[^]
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
How can I pack MSDE with my application and check if MSDEexist and then automatically install database.
|
|
|
|
|
As far as I know, you could not do that. I think I might see this kind of question before in this forum and some people tell them to try bootstrapper... I'm not sure too.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Hello everybody. I am trying to retrive data from a Access Database containing two tables.
1) tblKeyword
2) tblArea
In tblKeyword there are two attributes: a) Keyword and b) AreaName
in tblArea there are couple including AreaName which is the connection between the two tables.
I am trying to use the following code:
========================================================================
Dim strConnection As String = OleDbConnection1.ConnectionString
Dim connect As New OleDbConnection(strConnection)
Dim test As String
Dim te As String
Dim SQLString As String
connect.Open()
te = cmbKeywords.Items(cmbKeywords.SelectedIndex)
On Error Resume Next
SQLString = "SELECT tblKeywords.Keyword, tblArea.AreaName, tblArea.StartDate, tblArea.JobNumber FROM tblKeywords INNER JOINT tblArea ON tblKeywords.AreaName = tblArea.AreaName WHERE tblKeyWords.Keyword =" & "'" & te & "'"
Dim cmd As New OleDbCommand(SQLString, connect)
Dim reader As OleDbDataReader = cmd.ExecuteReader()
While reader.Read()
txtAreaName.Text = reader.GetValue(1)
End While
========================================================================
The SQL command goes through OK but the reader.Read is causing an error. How can i retrive the data from that SQL. I am lost.
I know that the GetValue gets a value from attributes in one table. But with the inner joint I need values from both tables.
Any help would be appreaciated. Thank you..
Still trying to find the way
|
|
|
|
|
Chaos Machine wrote:
The SQL command goes through OK
What you mean is that you are able to create the SqlCommand, however no validation is done on the provided SQL string provided at this point.
Chaos Machine wrote:
but the reader.Read is causing an error
At the point of opening the datareader, the SQL provided is executed, so any syntactical errors will be thrown here.
Chaos Machine wrote:
INNER JOINT
Now, if that were my mistake it would've been freidian
Oh, and another pointer:
Chaos Machine wrote:
I know that the GetValue gets a value from attributes in one table. But with the inner joint I need values from both tables.
By doing an join, you are effectively creating one table (albeit a virtual table that doesnt exist in the DB). Your single table will have the columns you specify in the select list:
Chaos Machine wrote:
SELECT tblKeywords.Keyword, tblArea.AreaName, tblArea.StartDate, tblArea.JobNumber
Hope it helps.
|
|
|
|
|
Hello J4amieC,
thanks for replying. I am still at a loss of what to do. Can you please show me with a bit of code how I can retrive the informations that i have collect from the SQL command? I am trying from books and online info, but still nothing. Thank you for your help.
Still trying to find the way
|
|
|
|
|
OK,
my comment was that you had a error in your SQLString (you used INNER JOINT instead of INNER JOIN) it should read:
SQLString = "SELECT tblKeywords.Keyword, tblArea.AreaName, tblArea.StartDate, tblArea.JobNumber FROM tblKeywords INNER JOIN tblArea ON tblKeywords.AreaName = tblArea.AreaName WHERE tblKeyWords.Keyword ='" & te & "'"
Now when you execute this string you will have the following columns:
0: Keyword (from tblKeywords)
1: AreaName (from tblArea)
2: StartDate (from tblArea)
3: JobNumber (from tblArea)
so if you use:
reader.GetValue(0)
you will get the Keyword column.
|
|
|
|
|
Thank you J4amieC it worked!!! Thank you so much. Now i have to expand this so when i have two areas with the same keyword a list is populated. Hmmm lets see if i can do it!! LOL
Thank you again for your help...
Still trying to find the way
|
|
|
|
|
How can I get the handle of an app that doesn't have a form?
Pablo.ar
|
|
|
|
|
No window means no hWnd either. What are you trying to do?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm trying to make a screensaver... Wait, let me rephrase that: I swear I'm trying to make a screensaver.
With this program, you'll be able to set whatever program to run when the ssvr execs (using the Shell function) or whatever file, to be loaded by the system (using the ShellExecuteEx function, that needs an hWnd to execute).
So...
Pablo.ar
|
|
|
|
|
I still don't know why you need a hWnd to a window that doesn't exist. Why are you trying to get this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok I got what you're looking for.
Try using a handle to another window that is actually availible.
I mean that i.e. use the GetForgroundWindow() API to get an availible handle and pass it to ShellExecute. Or you can use the handle to the Desktop window, etc.
Hope it helps.
|
|
|
|
|
The 'desktop window' is a great idea, I'll investigate if there is such a thing, or something similar (with a handle!) that I can use.
Thanks a lot, MohammadAmiry.
Pablo.ar
|
|
|
|
|
well i want my windowform to be invisible but i want to be-able too make it visible again. u can make a message box and all, but does anyone know how to make a icon appear in the |Start ToolBar|?
thank ya
|
|
|
|