|
Did you try: textbox.Text = DataGridView1.Item("LastName", 1).Value
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Hi,
Yes I tried it but I got an exception( Index was out of range.Must be non-negative and less than the size of the collection. Parameter: Index)
thanks again
|
|
|
|
|
OK, well, how are you choosing the index? You must be passing one that's out of range.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Hi,
I have a datagridview with the following columns( ID,Title,Las_name, First_Name, Middle_name)
Lastnamelabel.text=datagridview.item("Last_name",2)
I did it this way I got the exception..
Thanks
|
|
|
|
|
Well, assuming that you actually spelled Las_name correctly in the column definition, are you sure you have at least 3 rows (0, 1 and 2) in your grid?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Hi,
Thanks a lot..
It works if one row. what if you have more than one row and want to list all the last_name into a listBox..
OR you want to select a particular row and parse its value.
Thanks
|
|
|
|
|
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.
|
|
|
|