|
Iam having a code on if-else statement:
If RST("Rep_enq") = Null Then
txtfindings.Text = ""
Else
txtfindings.Text = RST("REP_ENQ")
txtfindings.Locked = True
End If
If I want to write this code using iif statement,How?
Thanx in Advance
Priya
|
|
|
|
|
With txtfindings
.Text = IIf(RST("Rep_enq") = Null, "", RST("REP_ENQ"))
.Locked = IIf(RST("REP_ENQ") = Null, False, True)
End With
"You can't trust code that you did not totally create yourself."
Ken Thompson
|
|
|
|
|
mnXtreme wrote: "You can't trust code that you did not totally create yourself."
Which of course not means that you can trust the code that you did create yourself.
---
single minded; short sighted; long gone;
|
|
|
|
|
i hv a form which xactly looks like a notepad.
it has menus like File & Edit. wen clicked on File it has options OPEN, SAVE, & SAVE AS.
wen clicked on Open Menu it takes the data only of *.txt files and the data is shown in textbox.
the problem is i want data of *.doc file that need to be shown in textbox so
how to convert data stored in *.doc file directly to *.txt file
plzzz reply as soon as possible
thnx in advance
|
|
|
|
|
|
Hello,
I used two Timer Controls.
one is in main project, the other is in Usercontrol.
(I made UserControl with Timer control)
This UserControl has included in project , not by ocx.
But, sometimes this timer in UserControl has stoped and restarted automatically.
I don't know why!
Anyone know about it?
Thanks.
sunny4252
|
|
|
|
|
Post your code here for examining and then I tell you why?
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
<br />
[Main Form]<br />
Private Sub Timer1_Timer()<br />
UserControlMiniPLC1.Output3 = True<br />
UserControlMiniPLC1.OutputCommandStatus = True<br />
.<br />
.<br />
UserControlMiniPLC1.Output3 = True<br />
UserControlMiniPLC1.OutputCommandStatus = True<br />
.<br />
.<br />
End Sub<br />
<br />
[UserControl]<br />
Private Sub Timer1_Timer()<br />
If m_OutputCommandStatus = True Then<br />
Call WritePLC<br />
m_OutputCommandStatus = False <br />
Else<br />
Call ReadPLC<br />
m_OutputCommandStatus = True <br />
End If<br />
End Sub<br />
<br />
Public Sub WritePLC()<br />
.<br />
.<br />
iOutput2 = IIf (m_Output2 = True, 1, 0)<br />
iOutput3 = IIf (m_Output3 = True, 1, 0)<br />
wdata = ~~ & iOutput2 & iOutput3 ~~<br />
MSComm1.Output = wdata<br />
.<br />
.<br />
End Sub<br />
<br />
sunny4252
|
|
|
|
|
There's nothing in this code that does anything with timers. How are you stopping and starting the timers?? Are you doing this based on some condition that has to be met? Have you instrumented and/or traced your code to see what it's actually doing?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Just checking the account... sorry..
|
|
|
|
|
Hi,
I m doing attenance automation project.I hv one form named Leave Details..tht form mainly contains four buttons namely
ADD
MODIFY
DELETE
SEARCH
But I want to use only one submit button for all the four...How can I do ths?Plz help me...
|
|
|
|
|
You are not clearly stating what you want. Try to be more specific. If you need a Button named as SUBMIT, so go for it. Define another button for submit and place the code inside of this button's click event. When you click it, it will be executed.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Thnks for ur advice....Actually I want to perform these three different operations(add,update,delete) with one submit button..Tht three operations are three functions..How can I call these functions within ths function..thnk now u got me...
LevDtlsAdd()-ADD
LevDtlsUpdate()-UPdate
LevDtlsDlte()-Delete
|
|
|
|
|
So how is your application going to know which operation is supposed to be performed??
Are you having the user type this stuff into a DataGridView? or some other data bound form?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello sir,
I have created a project in .net2005 and its running fine.Now when i take the same project and if i try to run in .net2003 its not running.Is there any version problem.Its shows that the vb.net project is not an valid project.
|
|
|
|
|
Obvious...
Vs2005 projects aren't compatible with previous versions of Visual Studio.Net...
Carmine,
Webmaster of: www.thetotalsite.it
My web blog: blog.thetotalsite.it
|
|
|
|
|
You can't go backwards like that. VS2005 projects wont load in VS2003. You can go the other way though, you can open a VS2003 project in 2005.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I've been trying to list all the registry values in a certain key, but I keep getting an "Object Reference Not Set to an Instance of an Object" error on the first line. My code is:
Dim GetValues As Microsoft.Win32.RegistryKey = My.Computer.Registry.LocalMachine.OpenSubKey("\Software\Microsoft\Windows\CurrentVersion\Run")
For Each ValueKey As String In GetValues.GetValueNames
Dim ItemRead As String = My.Computer.Registry.GetValue(GetValues.ToString, ValueKey, "")
'Add Items to ListView
GlobalList.Items.Add(ItemRead)
Next
Is there maybe a better way to list the registry values than the way I've been trying? Nothing seems to work.
Thanks for the help.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Take the slash in front of "\Software\..." out. It should be "Software\...".
Your code is ASSUMING that OpenSubKey is actually returning something. It'll help if you checked GetValues (that's a bad variable name BTW) for an object before you try and use it in your loop. You might also want to get the values from the Run key you opened and not from the root of Local Machine. Also, you have to close the key you opened when you're done with it.
Dim runKey As RegistryKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run")
If Not runKey Is Nothing Then
For Each valueName As String In runKey.GetValueNames()
Dim itemValue As String = runKey.GetValue(valueName, "").ToString()
Debug.WriteLine(String.Format("{0} : {1}", valueName, itemValue))
Next
runKey.Close()
End If
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for the help!
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
hi guys does anyone know how to list all the files that are in the bin folder that are xls format(.xls) to a listbox i am trying to learn how to do this so could any one teach =P
|
|
|
|
|
Try this:
For Each xslFile As String In My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.CurrentDirectory, FileIO.SearchOption.SearchTopLevelOnly, "*.xsl")
MsgBox(xslFile)
Next
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Have your folder as a string.
Dim Folder as string = 'your project directory
Dim file as system.io.fileinfo
dim fol as new system.io.directoryinfo(folder)
for each file in fol.getfiles(".xsl")
listbox1.items.add(file)
next
Posted by The ANZAC
|
|
|
|
|
I posted this question on the ADO.NET board, but the only reply I got was that I need to check my Update code.
I have an Access database with a Date/Time column. I used the VS.NET forms designer to create an OleDbDataAdapter and DataSet from the datasource. The DataSet created has the Date/Time column with a DateTime type as expected. The Fill and Update methods work properly without exception. However, after an insert or update, the data that actually gets stored to the database has a time of 12:00:00 AM, requardless of the time I specified while running the application.
One solution I have thought of, but not tried, is to change all DateTime column types in the Typed-DataSet to OleDb.Date.
Thanks,
Scott Page
"Some people spend an entire lifetime wondering if they made a difference. The Marines don't have that problem."
( President Ronald Reagan)
|
|
|
|
|
I'm working on an ASP.NET 2.0 web application (VB) that needs to be internationalized. Extended ResourceProviderFactory and IResourceProvider and have an AccessResourceHelper to get the resources from the Access DB. Most of the resourceses works except for the 'Implicit' ones. I must be missing something.
If you need to see my code let me know..
Will post it.
Any help will be greatly appreciated,
HR
|
|
|
|