I have a code below in an Entity Class. It throws exception in the Entity.Designer.vb saying the value Amount in Table Patient is DbNull.      If _patientDetails.ID &gt; 0 Then         If _patientDetails.Amount = EntityEnums.Patient.Existing             Then                                          _patientDetails.SetAmountNull()         End If     Catch ex As Exception         _patientDetails.SetAmountNull()     End Try  End If   It goes to the "Return" line as below and throws exception.  Public Property Amount() As Integer     Get         Try              Return CType(Me(Me.tablePatient.AmountIDColumn),Integer)         Catch e As Global.System.InvalidCastException             Throw New Global.System.Data.StrongTypingException("The value for column 'AmountIDColumn' in table 'Patient' is D"&amp; _                      "BNull.", e)         End Try     End Get     Set         Me(Me.tablePatient.AmountIDColumn) = value     End Set End Property   Exception Details are   A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll  Additional information: Conversion from type 'DBNull' to type 'Integer' is not valid.
I want to generate some formatted output of data retrieved from an MS-Access database and stored in a DataTable object/variable, myDataTable. However, some of the fields in myDataTable cotain dbNull data. So, the following VB.net code snippet will give errors if the value of any of the fields lastname, intials, or sID is dbNull.     dim myDataTable as DataTable    dim tmpStr as String    dim sID as Integer = 1     ...    myDataTable = myTableAdapter.GetData() ' Reads the data from MS-Access table    ...     For Each myItem As DataRow In myDataTable.Rows      tmpStr = nameItem("lastname") + " " + nameItem("initials")      If myItem("sID")=sID Then         ' Do something     End If      ' print tmpStr     Next   So, how do i get the above code to work when the fields may contain dbNull without having to check each time if the data is dbNull as in ?
What does `invalid initialization of non-const reference` mean? Anamorphic Perspective in Illustrator or Photoshop? Clerical error in UK visa application, but form already submitted - what should I do? I'm from the Philippines, and I plan on travelling to the UK with my sister to visit a relative.  I have just submitted my visa application and have already paid online, when I noticed that I've made a clerical error. In the 'visit or stay' portion of section "Do you have any friends or relatives in the UK?", I clicked the 'no' box, instead of 'yes'.  My sister's application is correct. She selected 'yes'. Our appointment is due next month. I am planning to email them about this, and also inform them on the day of application submission.  Is this the right path to take? Ubuntu 12.04 comes with Gimp 2.6, so I installed Gimp 2.8 using the instructions below:   sudo apt-get purge gimp*   sudo add-apt-repository ppa:otto-kesselgulasch/gimp   sudo apt-get update   sudo apt-get install gimp    When try to open help, I get the message below. How do I install and configure the help for 2.8 on Ubuntu? Is there a single word with the same meaning as "good moments" or "pleasant memories"? I'm looking for a word which describes good thing(s) that happened to someone. The only word I can think of is "joy".  Some examples might be:   Wayne has many pleasant memories of the days spent with the family. She could remember many good moments from the last weekend. How to connect two parents to the same child, with parents not in the same tree? I'm trying to draw a specific tree, with two parents node linked to the same child. The problem is that one of the parent is outside the main tree.  Here's the code I have for the moment:  \documentclass{article} \usepackage{tikz-qtree,tikz-qtree-compat} %\usepackage{gb4e} \usepackage{forest}  \begin{document}  %\begin{exe} \begin{forest} qtree edges/.style={for tree= parent anchor=north, child anchor=south}    [A, grow=north        [C, name=C, grow'=north            [D, grow=north ]            [E, name=t5, grow=north ]        ]        [B, grow=north ]    ]    \hspace{0.8cm}    [$F$, name=F, grow=north ]    %\draw (F.north) -- (C.south); \end{forest} %\end{exe}  \end{document}   I'd like the nodes F and C to be connected. I don't know why, but if I delete the dollar signs, node F doesn't even appear on my document.  Another thing is that I want the forest environment to be embedded in an example environment, but this doesn't work either.  Thanks in advance for your help! As teenager Tom Riddle is speaking to Harry Potter in the Chamber of Secrets, both he and Harry are refering to the real Voldemort in the third person. If Tom Riddle had succeeded in sucking all the life energy out of Ginny and had come back alive, wouldn't that have meant there were two Voldemorts in the world? The wraith one which had lived in Quirrell, and the newly constituted one?  This Tom Riddle clearly doesn't have the memories of the wraith version.   As a bonus: If they both existed, would they have competed against each other? How can one expand the function $f_1(x) = x$ on $(−π, π)$in terms of the functions $\cos nx, n = 0, 1, 2, ...$ and $\sin nx, n = 1, 2, ...,$ in a way so that $$f_2(x) = a_0 + \sum_{n=1}^{\infty}(a_n \cos nx + b_n \sin nx)$$ is the expansion of the $f_1$, how is that? I have asked  related to the same issue but didn't get full answer, I have been told that this is a standard application of Fourier series, $f_1$ and $f_2$ are equivalent in the sense that $f_1(x)=f_2(x)$ for all $x∈(−π,π)$. For any $x$ in this interval, the Fourier series will converge to $f(x)$, but I didn't get any rigorous proof  with elaborate explanation. So, plz provide rigorous proof of $f_1=f_2$ with elaborate explanation as I am new to the subject. Thanks You. I have attached the excerpt below - Is there an AmpScript function that can be used in an equivalent manner to sql left, right and mid functions?   Thanks, Mark How do I upgrade from 12.10 to 13.04? Where can I obtain an English dictionary with structured data? Simple enough question: What math should all game programmers have a firm grasp of in order to be successful?  I'm not specifically talking about rendering math or anything in the niche areas of game programming, more specifically just things that even game programmers should know about, and if they don't they'll probably find it useful.  Note: as there is no one correct answer, this question (and its answers) is a community wiki.  Also, if you would like fancy latex math equations, feel free to use . How can I make an overset symbol at the same size and height as \bar except with a different symbol? Apologies for the cryptic title, but I was not sure how best to phrase the question in one sentence. I am essentially trying the create a vector symbol with \rightharpoonup as the top instead of the arrow.  The output to the following code will feature an overset harpoon over x, next to a simple \bar{x}. Observe that on the left, the top symbol is significantly higher and bigger than on the right one.  \documentclass{article}  \usepackage{amsmath,amsfonts,amsthm,amssymb}  \newcommand{\vect}[1]{\overset{\rightharpoonup}{#1}}  \begin{document} $$ \vect{x} \quad \bar{x} $$ \end{document}   I would like to create something that looks in every way like the right hand symbol, except using something that looks like \rightharpoonup at the top.  If this command sequence already exists in LaTeX, please use that as an answer, because I have searched for and failed to find it so far. I am watching Susskinds's lecture , in which he introduced square angular momentum operator $L^2$, which can be written as $$ L^2=L_z^2+L_-L_++L_z $$ where $$ L_\pm=L_x\pm iL_y $$  Besides, he argued that the spectrum of $L$ can only be $m,m-1,\cdots,-m+1,-m$ in which $m$ is an integer or half-integer. If we denote $|m\rangle$ the eigenvector corresponds to eigenvalue $m$, we have $$ L_\pm|l\rangle=|l\pm 1\rangle\;\text{or}\;0 $$  In the lecture he showed that $L^2|m\rangle=m(m+1)|m\rangle$ for $m$ the highest eigenvalue, by $$ \begin{align*} L^2|m\rangle&amp;=L_z^2|m\rangle+L_-L_+|m\rangle+L_z|m\rangle\\ &amp;=m^2|m\rangle+0+m|m\rangle\\ &amp;=m(m+1)|m\rangle \end{align*} $$  Then he left an exercise to show that for any $-m\leqslant l&lt; m$, we also have $|l\rangle$ is an eigenvector of $L^2$ with eigenvalue $m(m+1)$.  In the lecture, he hinted by showing that it suffices to show that $L^2$ commutes with $L_i$ for $i=x,y,z$, which gives us $$ L^2|m-1\rangle=L^2L_-|m\rangle=L_-L^2|m\rangle=L_-m(m+1)|m\rangle=m(m+1)L_-|m\rangle=m(m-1)|m-1\rangle $$  I believe it is true since I find the   online.   However, my question is that, why the following proof is wrong.  I tried to mimic the proof for $|m\rangle$ to have that  $$ \begin{align*} L^2|k\rangle&amp;=L_z^2|k\rangle+L_-L_+|k\rangle+L_z|k\rangle\\ &amp;=k^2|k\rangle+L_-L_+|k+1\rangle+k|k\rangle\\ &amp;=k^2|k\rangle+|k\rangle+k|k\rangle\\ &amp;=(k^2+k+1)|k\rangle \end{align*} $$  which shows that $|k\rangle$ does not have eigenvalue $m(m+1)$ but $k^2+k+1$ for $k&lt;m$. Is the phrase "for free" correct? Tensor product in dual-space I am a bid confused regarding the notation for tensor products when going into dual-space  If $\left| \Psi \rangle \right. = \left| A \rangle \right. \left| B \rangle \right.$ is $ \left. \langle \Psi \right| = \left. \langle A \right| \left. \langle B \right|$ or $\left. \langle B  \right| \left. \langle A \right|$?  My guess is the last choice, since operators should act on   $\left| 0 \rangle \right. = \left( \begin{matrix}   1 \\   0  \end{matrix} \right) $  $\left| 1 \rangle \right. = \left( \begin{matrix}   0 \\   1  \end{matrix} \right) $  so  $\left| 01 \rangle \right. = \left| 0 \rangle \right. \left| 1 \rangle \right. = \left( \begin{matrix}   0 \\   1 \\   0 \\   0  \end{matrix} \right) $  But then, for me, it should be  $\left( \begin{matrix}   0 &amp; 1 &amp; 0 &amp; 0  \end{matrix} \right) = \left \langle 10 \right|$ But this is not correct if i calculate the tensor product, since   $\left \langle 1 \right| \left \langle 0 \right| = \left( \begin{matrix}   0 &amp; 0 &amp; 1 &amp; 0  \end{matrix} \right)$  For instance, shoulden't it be  $\left| 01 \rangle \right. \left \langle 10 \right| = \left( \begin{matrix}   0 &amp; 0 &amp; 0 &amp; 0\\   0 &amp; 1 &amp; 0 &amp; 0\\   0 &amp; 0 &amp; 0 &amp; 0\\   0 &amp; 0 &amp; 0 &amp; 0\\  \end{matrix} \right) $ ?  I hope I have made my confusion clear How to subtract days from a plain Date? Closing Streams in Java Includegraphics maximum width Questions can be closed or marked as duplicates.  What does it mean for a question to be &quot;closed&quot;? What does it mean for a question to be marked as a &quot;duplicate&quot;? Who can close a question? What are the reasons for closing a question ? Is closure the end of the road for a question? When are closed questions eligible for deletion?   Related        For more information, see &quot;&quot; in the .