|
Hello all,
This is probably a simple issue but since I am a newbie I am really stuck on it. I have been developing some code (VB.Net 2005) and I was using rowPosition to pull data from an Access Data base and I changed it to something that will read through and match up my primary keys (MR#). Anyway this works fine as long as I have data in every field in the table. But if/when it finds a field that is blank (Null) I get this error “The value for column 'SurgType' in table 'Pat01Surgery' is DBNull.”
This is the code I was using before….
'If dtSurgery.Rows(rowPositionSurg)("SurgType") Is DBNull.Value Then
' rdbtnInpatient.Checked = False
' rdbtnOutpatient.Checked = False
'ElseIf dtSurgery.Rows(rowPositionSurg)("SurgType")= "I" Then
' rdbtnInpatient.Checked = True
'ElseIf dtSurgery.Rows(rowPositionSurg)("SurgType") = "O" Then
' rdbtnOutpatient.Checked = True
'End If
Now I am trying to use this code....
'If ShowSurg.SurgType Is DBNull.Value Then
'If IsDBNull(ShowSurg.SurgType) Then
If ShowSurg.SurgType Is String.Empty Then
rdbtnInpatient.Checked = False
rdbtnOutpatient.Checked = False
ElseIf ShowSurg.SurgType = "I" Then
rdbtnInpatient.Checked = True
ElseIf ShowSurg.SurgType = "O" Then
rdbtnOutpatient.Checked = True
End If
This code used to work fine before I had to change it. Now I can’t seem to get the snytax right or something. As can tell I have tried several different ways to look for null. But it still kicks out that error.
Can anyone give me some advice on how this should be entered? I am still learning so you may have to dummy it down for me. Thanks in advance for any help you can give.
|
|
|
|
|
You can check for NULL values as follows:
<br />
If dtSurgery.Rows(rowPositionSurg).IsNull("SurgType") Then<br />
|
|
|
|
|
Thanks! I couldn't use exactly what you suggested (because that is what I was doing before) but it did open my eyes to see the answer. This is what I am using now and it seems to work just fine....
If ShowSurg.IsNull("SurgType") Then
Thanks again!
|
|
|
|
|
i have linked the wireless to the hyperterminal of the windows...
data is comin to hyperterminal...
now i want to store that hyperterminal dta in backend through front end....
but finding problem in storing data in back end..
any help..???
thanks
|
|
|
|
|
I have a form with a tab control with several tabs. The main tab has many controls on it. The app is performing various "tests" and displaying pass/fail in the main tab. One of the tests is a communication test. It sends out a message and expects an asynchronous reply within a certain timeout.
When I click on a tab and then go back to the main tab, it takes almost a second for all the controls to be repainted. This causes the CPU to peg at 100% usage and will occasionally cause my communication test to timeout (the timer expires before the reply is received).
Does anyone have any ideas to get around this problem? I have already increased the timeout period as much as I want to. I also do not want to disable the test when I switch tabs.
Thanks
VF
|
|
|
|
|
Just brainstorming but I would think about threading the UI and try to get a lazier load if possible.
Here are the articles I have used
|
|
|
|
|
|
You were correct! I was doing everything inside the UI thread. I redesigned the app to use threads for each of my tests. Now the test never fails, even when the CPU is maxed at 100%!!!
|
|
|
|
|
Great to hear did you get a chance to work with the background worker object or did you write your own threading class?
|
|
|
|
|
I am building an application which will run on PocketPC (2003 SE and Mobile 5.0) Devices (barcode scanners) located in different companies who will use my application.
As part of the application, the application will connect to a webservice (which I am also writing) running at the company location (ie, each company has their own IIS WebService).
I am aware of the Dynamic URL setting. Not a problem. However, everything that I am reading talks about establishing the configuration prior to distribution.
The Problem: Each Company will logically setup their web services with a different URL: ie, http://192.168.0.4/webservicename , http://companymachine/webservicename ). In looking for this answer, I have not come up with any discussion about the ability or sample code.
I am looking for VB.NET code which will permit administration to either enter the webservice URL on the PocketPC device or code which will pull in the WebService URL from a file (TXT or XML) on the Pocket PC device.
The thought is if the PocketPC Application can read the URL values from a file, then the PocketPC Application can be distributed globally to different companies and each company is then in the position to provide their unique URL. The alternative is to maintain builds for each company location which would be an insanely inefficient approach.
Michael
|
|
|
|
|
friend try this out
there is a file reference.vb under the webreference > reference.map
there you can give URL of the webservice dynamicaly
Namespace Service1
Public Class Service
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
'<remarks>
Public Sub New()
MyBase.New()
Me.Url = "http://" & functionThatReadURLFromTextFile() & "/WebServicesName/Service1.asmx"
End Sub
End Class
End Namespace
Milan
|
|
|
|
|
Sir/madam,
I want to convert the adate in the following format
dd/mm/yyyy hh:mm tt
how should i do that
Thanks and Regards
Pankaj Garg
|
|
|
|
|
Hi,
try the following
<br />
MsgBox(Now.ToString("dd/MM/yyyy hh:mm tt"))<br />
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
try this coding
dim yourstring as string
yourstring = datetime.now
textbox1.text=yourstring
u'll get date n time in required format
|
|
|
|
|
|
Hi i have two html pages...,
In first html page i have some two links like(link1, link2)...,
In another html page i have 8 links like (link1 to link8)...,
If i click in first html page that "Link1", then its want to go second html page and show first 4 links(link1 to link4)...,
in that time that link5 to link8 want to be hide(visible=false)...
Similarly,if i click "Link2" then its want to go second html page and show last 4 links(link5 to link8)...,
in that time that link1 to link4 want to be hide(visible=false)...
How to do this one...,
Plz help me......
Magi
|
|
|
|
|
Why not just pass the 4 hyperlinks to the second page and set them manually when you transfer control to it? You could also do the same with just passing a single value to the second page and setting 4 textboxes with links to the specific values you want to display.
David
|
|
|
|
|
Hi plz send the code...,
I didnt get the answer...,
Plz hlp me...
Magi
|
|
|
|
|
Here's an article with some sample code on how to pass information from one html page to another: http://www.vbdotnetheaven.com/UploadFile/avi_sanjay/ServerTransfer02222007000910AM/ServerTransfer.aspx
You can transfer which link they clicked on from the first page (or make it have two buttons instead or something). Or, even better, why not just have three html pages in this format:
Page 1:
Click Link/Button 1 - Goto page 2
Click Link/Button 2 - Goto page 3
That way you don't have to do anything fancy to make it work.
David
|
|
|
|
|
I want to write an application in vb.net which will accept input only from the keyboard numeric keys. Can anyone pls suggest how do i go about it..
|
|
|
|
|
|
Put this in the forms keydown event, it will block all keys other than the numpad:
If e.KeyCode < Keys.NumPad0 OrElse e.KeyCode > Keys.NumPad9 Then<br />
e.handled = true<br />
End If
This works because all keys are numbered and the numpad keys are numbered consecutively. This statement rejects all keys that don't fit between the 0 and 9 on the numpad. Make sure the forms keypreivew property is set to true.
This will allow top numbers and numpad(I think).
If e.KeyCode < Keys.D0 OrElse e.KeyCode > Keys.D9 Then<br />
e.Handled = True<br />
elseIf e.KeyCode < Keys.NumPad0 OrElse e.KeyCode > Keys.NumPad9 Then<br />
e.Handled = True<br />
End If
Posted by The ANZAC
|
|
|
|
|
Thanks a lot...it was a very useful information
|
|
|
|
|
your welcome.
Posted by The ANZAC
|
|
|
|
|
well u might be using textboxes to enter the values..
lets take two textboxes
so its easy man..
jst have allok at this code...
in keypress event like
Private Sub Text1box_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress, TextBox2.KeyPress<br />
dim keyascii as short= Asc(eventargs.keychar)<br />
select case keyascii<br />
case 48 to 57 ' numeric keys 0 to 9 <br />
case 8 ' backspace<br />
case else ' other keys<br />
keyascii = 0<br />
end select<br />
if keyascii = 0 then <br />
eventargs.handled = true<br />
end if<br />
end sub<code>
|
|
|
|