|
dim con as new oledbconnection("connectionstring")
con.open
dim ds as new dataset
dim ad as new oledbdataadapter("query",con)
ad.fill(ds)
combobox1.displaymember=""
combobox1.valuemember=""
combobox1.datasource=ds.tables(0)
Hope this may help u.
|
|
|
|
|
How do I get javascript such as that listed below to be read in an ASP file before the command <%response.redirect "file.asp"%>
<%response.redirect "file.asp"%>
At the moment it just redirects to file.asp without executing the javascript.
If I remove <%response.redirect "file.asp"%> then the javascript is read, however when I add <%response.redirect "file.asp"%> the javascript is ignored and it just redirects to file.asp. Any ideas why this is happening?
|
|
|
|
|
Why do you have the response.redirect in server tags ? Why not do the redirect in javascript ?
I believe the issue is that the VBScript is executed first, to render the page, on the server. Then, the javascript runs on the client.
This question has nothing to do with VB or VB.NET, it belongs in the web dev forum.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Actually the full vbscript code is:
<%id = request("id")
sql = "Select * from listings where id ="&id
open_recordset rs,SQL
hits = rs("hits") + 1
sql ="update listings set hits ="&hits&" where id = "&id
conn.execute(sql)
url = rs("url")
closelink(rs)
closeDB()%>
<%response.redirect iurl(url)%>
Could you advise how, if possible, the redirect statement could be converted to javascript using the same variables?
|
|
|
|
|
Hi:who know use Shared Event Handler?i got problem,i dont this method can use communicated in on computer.one side is server,another side is client.server want to display message in the Listbox,so use this method to get message from client side.can?who know aboout it? can give code?thax
|
|
|
|
|
HI:I dont know the Shared Event Handler can use in one communication two computers.i want to know this method whether can use one side get message frome anther side.thax.
|
|
|
|
|
Hi!
Some one gave me below code in here. I have been trying to convert below code in vb.net
------------------
Dim oldText as string
Dim newText as String
Dim start as Integer, end as Integer
oldText = "I want #this# word bold"
start = Pos("#", oldText) ' Get pos of first #
end = Pos("#", oldtext, start) ' Get pos of first # after start pos.
newText = Strip(oldText, "#") ' Removed # from text
PPSlide.Insert(newText)
PPSlide.Select(newText, start, end)
PPSLide.Selection.Fond.Bold = true
------------------
but there is no method for this code
end = Pos("#", oldtext, start) ' Get pos of first # after start pos.
so how else could i get the position of first # after start pos
please help
|
|
|
|
|
|
uglyeyes wrote: Pos
IndexOf
uglyeyes wrote: Strip
Replace
I'd recommend that if you're having this much trouble with working out string functions, which appear in intellisense, that you buy a VB.NET book and work through it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thanks guys may be i didnt mention it clearly i dont have any problem getting start and end for the first time. I mean How do i loop through all the strings so that i get all the texts that are in between '#'
|
|
|
|
|
One easy way is to use the split function on the string class. This will return an array of substrings, so you can move through them, known that one denotes the start of a bold section, then next, the end of it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Use substring function.
It acceps 3 arguments("I want #this# word bold",start+1,end-start-1).
Here start will be 7(first #),end will be 12(second #).
So U want characters from 8 to 11.
Regards,
Arun Kumar.A
|
|
|
|
|
I check the intellisense it only supports upto 2 argument in vb.net (1.1) both int and int,int
I am trying to print all the text in bold that are inside # in powerpoint.
Dim oldText As String
Dim newText As String
Dim starts As Integer, ends As Integer
oldText = "I want #this# bold. I want #that# bold.I want #this# bold. I want #that# bold."
'This gets the first
starts = oldText.IndexOf("#")
'get second occurance
ends = oldText.IndexOf("#", starts + 1)
'NEXT STEP
newText = Replace(oldText, "#", "")
PPSlide.Insert(newText)
PPSlide.Select(newText, start, end)
PPSLide.Selection.Fond.Bold = True
PPSlide is a interop power point object.
|
|
|
|
|
uglyeyes wrote: newText = Replace(oldText, "#", "")
PPSlide.Insert(newText)
PPSlide.Select(newText, start, end)
I U use replace, will the start and end remains same?
Regards,
Arun Kumar.A
|
|
|
|
|
Of course not, the string gets smaller by two characters.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes, that is what I tried to bring to his notice.
Regards,
Arun Kumar.A
|
|
|
|
|
hope this helps U.
Dim oldText As String
Dim newText As String
Dim starts As Integer, ends As Integer
Dim startsNew As Integer, endsNew As Integer
Dim i As Integer
oldText = "I want #this# bold. I want #that# bold.I want #this# bold. I want #that# bold."
Dim boldCount As Integer,newPosition As Integer,compensateForReplacement As Integer
newPosition=0
compensateForReplacement=0
boldCount=(Number of #es)/2
newText = Replace(oldText, "#", "")
PPSlide.Insert(newText)
For i = 1 To boldcount
starts = oldText.IndexOf("#",newPosition)
ends = oldText.IndexOf("#", starts + 1)
startsNew=starts-compensateForReplacement
endsNew=ends-compensateForReplacement
PPSlide.Select(newText, startsNew, endsNew)
PPSLide.Selection.Fond.Bold = True
newPosition=ends+1
compensateForReplacement=compensateForReplacement-2
Next
Regards,
Arun Kumar.A
|
|
|
|
|
Hi Many thanks but i came up with below code
---------------------------------
Dim ppItem As Microsoft.Office.Interop.PowerPoint.Shape
LOOP
Dim s As String = dr.Item(Strings.Right(Trim(ppItem.TextFrame.TextRange.Text), _
Len(Trim(ppItem.TextFrame.TextRange.Text)) - 1))
s = s.Trim
ppItem.TextFrame.TextRange.Text = s
'ppItem.TextFrame.TextRange.Text = s
'========================
Dim a, b, looplen As Integer
looplen = s.Length
Dim hashWords As String()
Dim strWord As String
For a = 0 To looplen - 1
If s.Substring(a, 1) = "#" Then
a += 1
For b = 1 To looplen - 1
If s.Substring(a, 1) = "#" Then
ppItem.TextFrame.TextRange.Text = strWord
ppItem.TextFrame.TextRange.Font.Bold = Microsoft.Office.Core.MsoTriState.msoCTrue
ppItem.TextFrame.TextRange.Text = s.ToString
MessageBox.Show(strWord)
'Microsoft.Office.Interop.PowerPoint = strWord
' PPSLide.Selection.Fond.Bold = True
strWord = ""
Exit For
End If
strWord += s.Substring(a, 1)
a += 1
Next
End If
Next
END LOOP
---------------------------
in above code, each dr value returns a text which is rendered to each textbox in powerpoint.
At a time it brings chunk of record for example
"#Headline#[linefeed]This is a headline.This headline is about #Book#".
now what my code does is bring only character that are between #. so i am having hard time rendering the text in powerpoint slide.
As you might notice:
ppItem.TextFrame.TextRange.Text = s [ it supplies all the strings to a text box, so i dont get the change to iterate through all the string and check #es and print the one with #es
could someone help please
|
|
|
|
|
Hi everybody,
has someone ever tried to serialize a Windows Form with all its controls and properties?
I'm open to all suggestions.
Thanks in advance
Milan Schoemig
Milan.Net
|
|
|
|
|
I guess you need to serialise the state of all your controls. I have done this, many times, but I've stored them in the registry. You could just as easily come up with a file format that contains the data needed to set a forms state.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Im having issues with my if statments for this program.
I have 3 ratiobuttons, each one should do a different task.
The first one works alright, but now the 2nd one will not work because of the logic i believe.
It should deduct the value from label3.text, only if
label3 is higher then the amount of the cheque which is Textbox1
If the value of textbox1 is higher then label3 it has to display a messagebox saying insuficient funds. and then deduct a service charge which is declared as 10$
Here is my code. if anyone is able to assist, it would be greatly appreciated.
Dim servicecharge As Integer
Dim transaction As Integer
Dim Balance As Integer
' Declare the value of service charge
servicecharge = 10
transaction = TextBox1.Text
Balance = Label3.Text
' Deposit Funds to the account
If RadioButton1.Checked = True Then
Label3.Text = TextBox1.Text
End If
' Process a cheque through the account, confirming sufficient funds, If returned NSF the account
' will not be deducted the amount of the cheque, but will be charged 10 dollars.
If RadioButton2.Checked = True Then
Balance = Balance - transaction
ElseIf transaction > Balance Then
MessageBox.Show("Insufficient Funds")
Label3.Text = Label3.Text - servicecharge
End If
' Service charge processed on the account.
If RadioButton3.Checked = True Then
Label3.Text = Label3.Text - servicecharge
End If
End Sub
|
|
|
|
|
PLease, please tell me this is not your actual code ? You have variables called RadioButton1 and RadioButton2 ?
aerosmith2k1 wrote: If RadioButton1.Checked = True Then
If the first button is checked, do this
aerosmith2k1 wrote: If RadioButton2.Checked = True Then
If the second one is checked do this ( even if the first was checked )
aerosmith2k1 wrote: ElseIf transaction > Balance Then
If radio button 2 is NOT checked ( that's what the elif does ) AND transaction > balance, then do this
aerosmith2k1 wrote: If RadioButton3.Checked = True Then
If radio button 3 is checked, no matter if the others are, do this.
I suspect your radio buttons work so only one can be checked, but I'd still do an elif to define the three radio button steps. It makes the code more efficient.
And, I think the elif you ARE using, is your problem. Have you tried stepping through the code in the debugger to see what happens, and how it differs from what you expect ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If RadioButton1.Checked = True Then
Label3.Text = TextBox1.Text
End If
If RadioButton2.checked then
If lbl3.value > textbox1.value then
Balance = Balance - transaction
Elseif textbox1.value > label3.value Then
MessageBox.Show("Insufficient Funds")
Label3.Text = Label3.Text - servicecharge
End if
End if
If RadioButton3.Checked = True Then
Label3.Text = Label3.Text - servicecharge
End If
If I am not wrong at getting your logic ,You can try this one
Develop2Program & Program2Develop
|
|
|
|
|
I greatly appreciate your help, very Patient
|
|
|
|
|
Hi boys and girls,
i tried to include a WGA check to my app (plz dont ask why o.o) so i downloaded Windows Defender and copied the "LegitLib.dll" from the program foler to my app folder.
with PE-Explorer i saw that there are the following functions inside this dll
1. LegitCheck
2. LegitCheckCA
3. GetNextStep
4. GetLastErrors
5. SetPartnerID
that sounds good but i have absolutely no idea how to include this into my app! could anybody hel and if its possible explain it me?
many thx!
Sereby
|
|
|
|