|
Sub listsponsor()
Me.CmbSponsor.DataSource = objreg.listsponsor
Me.CmbSponsor.DisplayMember = "distID"
Me.CmbSponsor.ValueMember = "distID"
End Sub
Private Sub CmbSponsor_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmbSponsor.SelectedIndexChanged
Me.txtsponsorformno.Text = objreg.getsponsorformno(Me.CmbSponsor.SelectedItem.ToString)
End Sub
Me.CmbSponsor.SelectedItem.ToString returns system.data.datarow view. i also notice on step into that selectedindexchange fire bfore line 2 in sub listsponsor
|
|
|
|
|
Ebube wrote: Me.CmbSponsor.SelectedItem.ToString returns system.data.datarow view
Its due to the fact that your ComboBox is Databound.
Use SelectedText instead.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I have an ASP (classic) application, I want to call MQ series from this application. Does anyone has sample code to do this.
Issue in detail: I have 5 fields in my ASP application, when the user enters data to this field I have to validate by putting these values to MQ series queue.
If somebody can help on this it would be great.
Asheej T K
Bangalore
asheejtk@yahoo.com
|
|
|
|
|
Hi
Please tell me how we use INF Tool for making setup of any VB6 project
Amit Battan Ror
battan20@gmail.com
|
|
|
|
|
Amit Battan Ror wrote: Please tell me how we use INF Tool for making setup of any VB6 project
Look at its documentation.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I have one arraylist
where i load up all bookinfo obj
and want to return the collection of bookinfo[]
I can do it the following way in c# but I need to know how can we type cast the following in vb.net:
ArrayList a=new ArrayList();
Bookinfo obj=new BookInfo();
return (BookInfo[])a.ToArray(obj.GetType());
|
|
|
|
|
I think thi will do it :-
Dim a As New ArrayList()
Dim obj As Bookinfo = New BookInfo()
Return DirectCast(a.ToArray(obj.[GetType]()), BookInfo())
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
|
Unless you are stuck with framework 1, don't use ArrayList at all.
Use a generic list. As it's strongly typed you don't need any casting:
List<Bookinfo> a = new List<Bookinfo>();<br />
Bookinfo b = new Bookinfo();<br />
a.Add(b);<br />
return a.ToArray();
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi all URGENT!!!
I posted this a long time ago and did not get any answers. can someone please help!!!
I have a vb.net datagridview. One col has a combobox, I want to populate another cell from within the same row as the ComboBox is based on the ComboBox selection.
Eg. ComboBox.Selectedtext="Yes" then DGV.DateGiven = date.today
Can someone please help me how to do this.
modified on Tuesday, November 25, 2008 7:59 PM
|
|
|
|
|
|
Dim dtDate(table.Rows.Count) as DateTime
Dim iValue(table.Rows.Count) as Integer
For row as Integer = 0 To table.Rows.Count
dtDate(row) = table.Rows(row).Item("DateColumn")
iValue(row) = table.Rows(row).Item("ValueColumn")
Next
Basically you keep recreating your arrays within the For..Next code block.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
This is a great suggestion, and similar to what I was doing.
The down side is that this array needs to be used by a different procedure and once I have gone out of scope in the dataset procedure the Arrays are empty when I get to the procedure they are to be used in.
THX
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Dim objStreamWriter2 As StreamWriter
Dim DTString As String
DTString = "C:\ETCLINK\" + Convert.ToString(Date.Now)
'Pass the file path and the file name to the StreamWriter constructor.
objStreamWriter2 = New StreamWriter(DTString)
I take a runtime error when the code is run. What is the problem? Thank you?
(objStreamWriter2 = New StreamWriter("C:\ETCLINK\09042008121212.txt") no problem here
|
|
|
|
|
Hmm.
Check out "DTString". When run it could be set to:
C:\ETCLINK\2001-01-01 11:11
This isnt a valid filename... The colon symbol ( : ) is a bad char.
|
|
|
|
|
I would concur with the other reply, although if you actually gave us the error message, we could provide a better answer.
If the problem is the resulting string from Date.Now, use the Format command to get the resulting string into the desired format.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hi,
i've a little problem.
i must read from db one record, some field are null value and i cannot write it in my form.
I have thought about using the function iif, but I don't succeed in having the hoped result.
this is my code
with myDatarow
Textbox.Text = IIF(.IsSCALANULL, "", .SCALA)
end with
this is the error message:
the value of the column 'SCALA' in the table 'IMMOBILI' is DBNULL
thanks...
|
|
|
|
|
Smells like Italian Pizza.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
You've been a member for over a year. Have you never noticed the entire site is in ENGLISH?
Blog link to be reinstated at a later date.
|
|
|
|
|
My Paranoid Hubby wrote: the entire site is in ENGLISH
Sometimes one wonders...
Despite everything, the person most likely to be fooling you next is yourself.
modified on Monday, September 8, 2008 9:21 PM
|
|
|
|
|
The best solution ofcourse is to adapt your query (SELECT ISNULL(YourTable.YourField, 0) etc). If you can not adapt the query, another solution is to use IsDbNull(Datarow.Item("YourField"))
If IsDbNull(Datarow.Item("YourField")) Then
Textbox.Text = ""
Else
Textbox.Text = Datarow.Item("YourField")
End If
Hope it helps,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Your solution just did the job. Thanks.
|
|
|
|
|
Please put your thank yous with the relivent postings, thoughout if you are thanking Dave Kreskowiak I would also like to take this opportunity to thank him for the help he has given me in the past , he truly is a Guru.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hi Eslam Afifi,
Your solution worked for me. thanks a lot
|
|
|
|
|
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|