|
To get a different row, just put the row index in the Item method. To get all the rows, loop through them all in a For loop or a For Each loop and add them wherever you want.
You know, this stuff is covered in beginning books and tutorials.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
|
Walt Fair, Jr. wrote: this stuff is covered in beginning books and tutorials.
Nah. Those tend to be boring and cause head aches. Anyway it's way easier to get a personal coach who reads aloud the relevant sentences, and types in useful hyperlinks ...
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Unfortunately, I never found a personal coach like that.
I'll bet you didn't, either?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Hi,
you have been very helpfull and kind.
Thanks for letting me lit my candle in your knowledge..
|
|
|
|
|
the Equals method checks for equality, so it answers a yes/no question and returns a boolean. That is not the way to copy some data. You need to access the right cell of the grid, take its value, and fit that into the textbox; if the value isn't a string, apply ToString().
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi,
Thanks..but can you guide me a bit?
|
|
|
|
|
you should learn to collect information from the official sources first; those would include:
- your course book on VB.NET and Windows programming;
- MSDN;
- Google;
- CodeProject articles.
If you studied those, and still have a problem, feel free to ask a good question here, and lots of people will help out.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Thanks for your advice..I will do that and continue to do that. One can never stop learning.
Best regard..
PS. will you guide me?
|
|
|
|
|
i have a vc++ code which are a drawing program.
how can i make it into an ocx so i can use it in vb.net??
|
|
|
|
|
You're in the wrong forum.
But, the control has to be written to support being compiled into an ActiveX control. If it's not, you'll have to rewrite it to support such. Ask further questions about this in the Visual C++ forum. It has nothing to do with VB.NET.
|
|
|
|
|
I need to successfully load and unload assemblies from my vb.net project in real time. Can anyone recommend a tutorial on this process?
Thanks!
|
|
|
|
|
I suggest you google around; look for "AppDomain", as you can't unload assemblies, all you can unload is an AppDomain, so you will have to load assemblies in a new AppDomain, then later unload that AppDomain.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Oh,sorry, yes I understand that this occurs through appdomains. And I've googled and binged my head off on this, but I have yet to find a good solid tutorial on the mechanisms of the process. I was hoping someone here might have a good book or link that would help me.
Thanks
|
|
|
|
|
I don't have any around here, however I would suggest you look at some of these[^].
That may be a little hard though with your head off.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
|
Hello, (know this isn't directly related to vb but didn't know which forum to ask so any help would be appreciated)
I am getting an error from IIS AppPool when attempting to call a WCF service which accesses a table in sqlexpress that's local to my PC. Using server explorer, I can access the table just fine and took the connection string right from server explorer and plugged it into the connection string area of the web.config. What do I need to do with IIS to allow it?
ConnString-> Data Source=xxxxxxxx\SQLEXPRESS;Initial Catalog=GBUtilities;Integrated Security=True"
The Error is (also used default app pool - doesn't matter):
System.Data.SqlClient.SqlException was unhandled by user code<br />
Class=11<br />
ErrorCode=-2146232060<br />
LineNumber=65536<br />
Message=Cannot open database "GBUtilities" requested by the login. The login failed.<br />
Login failed for user 'IIS APPPOOL\Classic .NET AppPool'.<br />
Number=4060<br />
Procedure=""<br />
Server=xxxxxxxx\SQLEXPRESS<br />
Source=.Net SqlClient Data Provider<br />
State=1<br />
StackTrace:<br />
at UtilMgr.GetMenuItems() in C:\inetpub\wwwroot\GB.Utilities.WS\App_Code\UtilMgr.vb:line 18<br />
at SyncInvokeGetMenuItems(Object , Object[] , Object[] )<br />
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)<br />
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)<br />
InnerException:
thank you
Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
In the connection string, try replacing Integrated Security=True with Uid=[user];Pwd=[password]
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi
This is not a problem, I'm just trying to make myself clear how ListView works in virtualmode
So, I have ListView1 in virtualmode.
My ListView1 gets virtualitems from array, "baseArray() as ListViewItem":
Private Sub ListView1_RetrieveVirtualItem(..)
Dim x As Integer
x = e.ItemIndex
e.Item = baseArray(x)
End Sub
This works fine and is really fast.
The thing that I don't understand:
Changing the text of displayed ListViewItem or it's subitem affects also the corresponding item in baseArray.
This:
ListView1.Items(iSomeIndex).SubItems(0).Text = "sNewText"
Changes also the corresponding item in baseArray. Why this happens?
It seems that:
ListView1.Items(iSomeIndex)
is actually (I mean physically, sorry for the expression)
baseArray(iSomeIndex)
I earlier thought, that virtualmode copies shown items from baseArray.
But it seems that virtualmode does not work quite that way.
Could some of you explain what happens when virtualmode gets items from baseArray.
Thanks.
|
|
|
|
|
A ListView shows objects, whether it is used in virtual mode or not.
If you set the item at index X to be baseArray(X), then you simply copy the object reference from inside your baseArray array towards the items array inside the ListView, so whatever you do to your ListView item is changing your object in the baseArray, as they are one and the same object.
BTW: it does not make sense to have an array that "shadows" your items in a ListView, when you decided you want virtual mode; virtual mode is meant to overcome memory or speed limitations, that would arise when you would put a huge number of objects on a ListView, which in non-virtual mode would mean they have to reside in memory. So with virtual mode, you could create kind of a caching scheme, where only the currently visible objects need to be in memory.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Thanks
First part of Your answer was clarifying.
But this is not clear yet:
"it does not make sense to have an array that "shadows" your items in a ListView
Do you mean that it's not clever to use an array of ListViewItems, because the array itself consumes memory or speed? But how could it be done then? Data needs to be provided somehow for the ListView.
Data shown in ListView is stored in Database. During startup data is collected into this baseArray. Do you mean that data could be taken from the database into cache in runtime?
jtpaa
|
|
|
|
|
jtpaa wrote: During startup data is collected into this baseArray
That means all data is in memory, and virtual mode will not bring anything.
jtpaa wrote: Do you mean that data could be taken from the database into cache in runtime?
Yes. A very simple implementation would be to have RetrieveVirtualItem to go out and fetch one item from the database and feed it to the ListView. That way, you would not be holding any data in memory yourself, and the ListView would hold whatever it needs, and no more.
I am not saying this is the best approach, as it would cause a lot of small Database operations. There typically is an optimum somewhere in between; if you are willing to spend the effort, you could:
- create a cache, keeping a limited number of items, using WeakReference to make them garbage collectable;
- inside RetrieveVirtualItem, first look for the item in the cache; if found, pass it on. If not, read a number of items from the database, add them to the cache, and pass on the wanted one.
That is why it is called virtual: the ListView will act as if it has all data, but in reality it only has part of the data at any one point in time, sufficient to show the visible parts.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Ok
But could we say that my virtualmode version was atleast 5% virtual
Yes, the first thing that comes into my mind is that DB operation can be a bit slow because Database can also locate in local network. But this could be solved by taking several items with one search into cache.
Second thing is sorting. There are two columns (alphanumeric strings) in my ListView and user must be able to sort both columns. Also in sorting itself there has been difficulties. I haven't find a way to sort mixed strings properly with sql query.
jtpaa
|
|
|
|
|
when a list is virtual, it can't sort as it does not hold all the data; sorting means either the list is not virtual, or you do the sorting, the list does the displaying.
You can do sorting by including that in the SQL statement; see the ORDER BY clause.
If you can and are willing to keep the data all in memory (and suffer a potential startup delay), there is no need for virtual mode. If not, you need to add something clever; using virtual mode would be a part of that; caching could also be; keeping one or two entire columns (for sorting) is also conceivable.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
We have a working program in VB6 that gets the Windows Registered users and organization from the registry. It works fine on XP, Vista, etc.
If fails on Windows 7 and I believe W2008.
It returns Microsoft (which is incorrect) for both.
When we tried it with VB.net 2008 using
my.computer.registry.localmachine etc
It also fails but the same way. Obj below contains the string Microsoft. The line under (s =) also has Microsoft.
Can get the names but not the values????
Why
Here is the code.
Dim i As Short = 0
Dim s As String = vbNullString
Dim VNAR() As Object, SKNamesAR() As Object, Obj As Object
Const RO As String = "RegisteredOwner", ROrg As String = "RegisteredOrganization"
Const CV As String = "Software\Microsoft\Windows NT\CurrentVersion\" ' & RO
Const CVRO As String = CV & RO, CVROrg As String = CV & ROrg
Dim RK As Microsoft.Win32.RegistryKey = _
My.Computer.Registry.LocalMachine.OpenSubKey(CV)
Dim RK2 As Microsoft.Win32.RegistryKey
VNAR = RK.GetValueNames()
SKNamesAR = RK.GetSubKeyNames()
RK2 = RK.OpenSubKey(RO)
i = i
Obj = RK.GetValue(RO)
i = i
s = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "RegisteredOrganization", vbNullString)
|
|
|
|
|