|
OK, this is really messed up.
Mr Oizo wrote: dgSongProperties.Rows(index).Cells("Genre").Value
You're getting the value out of the datagrid by an index?? Where's the index coming from?
Your posting single lines of code, but nothing around it, or what events these lines are in, so it's really difficult to get a hnadle on what your doing. We can go round and round with little bits of your code all month and still not get it fixed because it would take a code review to see what you did where and why. That simply isn't going to happen in a forum environment. (Don't even think of posting the entire project somewhere. I don have my own job to do and I have a life.)
|
|
|
|
|
Hi. The index was from a for loop that returns the index of the selected row in the datagridview. All I need is for the selected rows genre column value to be the value that is dislayed in the combobox. I am aware that you must be a busy man. Very sorry for bugging you but I'm just stuck with such a small thing
Mr Oizo
|
|
|
|
|
|
Well im using a loop so i can select that row index for updating(wasn't sure if there was another way, still a dumb student )
the loop is as follows:
For i = 0 To dgSongProperties.Rows.Count - 1
If dgSongProperties.Rows(i).Selected = True Then
index = i
Call ShowCurrentSong(index)
End If
Public sub ShowCurrentCong(index as integer)
'other code for the various fields (which works fine)
If (dgSongProperties.Rows(index).Cells("Genre").Value) Is DBNull.Value Or (dgSongProperties.Rows(index).Cells("Genre").Value) Is Nothing Then
cmbGenre.SelectedValue = ""
Else
'this is the problem code
cmbGenre.SelectedValue = CStr(dgSongProperties.Rows(index).Cells("Genre").Value)
End If
End sub
If you want me to stop asking you questions i will. I understand
Mr Oizo
|
|
|
|
|
We are developing a windows application that has several projects under one solution.
The problem we have run into is that we have connectionstrings in app.config files for each project.
We would like to have just one config file that all of the projects in the solution use.
Is there a way to do this or are there other ways that people normally handle this.
|
|
|
|
|
Hi,
Dim cfgMap As New ExeConfigurationFileMap
cfgMap.ExeConfigFilename = "MyConfigFile.exe.config"
cfg = ConfigurationManager.OpenMappedExeConfiguration(cfgMap, ConfigurationUserLevel.None)
For i As Integer = 0 To cfg.ConnectionStrings.ConnectionStrings.Count - 1
MsgBox(cfg.ConnectionStrings.ConnectionStrings(i).ConnectionString)
Next
Note: The type of extra applications in your solution is dll or exe?
Hope this helps
|
|
|
|
|
Pardon my ingorance but what should cfg be declared as ?
Thanks in advance...
|
|
|
|
|
You can find that out by looking at the return type of the ConfigurationManager.OpenMappedExeConfiguration method, which is Configuration out of the System.Configuration namespace.
|
|
|
|
|
Hi,
By default, when adding a folder to a C# project, it will affect the namespace of new classes contained there.
EG: Add a folder called dummy. then a class below, the IDE automatically inserts "namespace classlibrary1.dummy" into the class.
Is there anyway to turn this on in VB.Net?
|
|
|
|
|
No, there isn't. The VB.NET IDE does not support automatically add Namespace statements at any time.
|
|
|
|
|
I have the following vb.net code :-
Dim bLogonResult As Boolean = Logon()<br />
If bLogonResult = True Then<br />
MessageBox.Show(bLogonResult)<br />
Else<br />
PDM.Common.ClientData.RestartApplication = False<br />
Me.Close()<br />
End If
Looks fairly straight-forwards. Right?
So why is it that when bLogonResult does equal True that it displays the message box then jumps to the Me.Close in the Else section?
Somewhat perplexing, I sure you would agree.
Any help appriciated
Thanks
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
I'd be tempted to try:
If bLogonResult Then .....
|
|
|
|
|
I tried that. I also tried If Logon() Then and IF Logon() = True Then
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Is it DEFINATELY going into the 'Else'? You haven't got another Me.Close further down?
|
|
|
|
|
ABSOLUTELY DEFINATELY. I have stepped thru the code in debug mode several time to make sure.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Bizarre!
How about something like:
Dim bLogonResult As Boolean = Logon()
If bLogonResult Then
MessageBox.Show(bLogonResult)
ElseIf Not bLogonResult Then
PDM.Common.ClientData.RestartApplication = False
Me.Close()
End If
|
|
|
|
|
Hi, I am trying to run a very simple application that keeps giving me an error that says invalidOperationException was unhandled, an error occured creating the form...I need help,thanx
Faruzzy.net!
|
|
|
|
|
Hi,
look at the entire exception text including the stack traceback, use the line numbers it
mentions (assuming a debug build), investigate the Form's constructor code.
Are you using extra threads, doing some illegal cross-thread Control access?
If you can't find it, publish all that information as is.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi,
I have a datagridview and on a column I have combobox.
When I choose a element from combobox I want to find the index of this element.
thanks.
|
|
|
|
|
Use the SelectedIndex property of the combobox.
Paul
|
|
|
|
|
yes, but I don't have an idea.
please give some script.
thanks
|
|
|
|
|
Have you checked the documentation[^]?
This is usually the best place to start.
Paul
|
|
|
|
|
I am running a program that search .wav, .wmv, and .mp3 files on the computer and automatically stores them into a database table. The table name is tblFileReport. I have another table called tblExclude which includes files that are excluded. However, I do not want to insert the file into tblFileReport if the file exist in tblExclude. For example, if "ExcludeFileName" is equal to filename then I don't want this file to be added to tblFileReport. But, if the file is not in tblExclude then add the file to tblFileReport. Here is the code that I have so far:
For Each folder As String In paths<br />
Try<br />
For Each file As String In My.Computer.FileSystem.GetFiles(folder, FileIO.SearchOption.SearchAllSubDirectories, patterns)<br />
fileName = System.IO.Path.GetFileName(file).ToLower<br />
<br />
Insert(file, fileName, CType(IPAddress.AddressList.GetValue(0), Net.IPAddress).ToString, System.Net.Dns.GetHostName)<br />
'End If<br />
Next<br />
<br />
Catch ex As UnauthorizedAccessException<br />
<br />
End Try<br />
Next
The string filename is the name of the file, for example chimes.wav, and if this name is equal to "ExcludeFileName" which is the filename column in tblExclude then do not add to tblFileReoport. I am thinking maybe an If, Then statement needs to be included in this code sample.
Any ideas?
jds1207
|
|
|
|
|
You could put an If..Else block around your call to Insert() that calls a method to check whether the current filename is present in tblExclude.
Paul
|
|
|
|
|
i want form with source code for quiz competition how can i get that please help me. if you have that please send it to my mail deep_eddy2002@yahoo.co.in
E.DEEPAK
|
|
|
|