ferreira12 Posted February 24, 2014 at 03:04 PM Report #546479 Posted February 24, 2014 at 03:04 PM Boas... Estou a passar valores nulos no código abaixo. sqlReader = sqlCommand.ExecuteReader() If sqlReader.Read() Then lblTeste.Text = sqlReader.GetInt32(0) End If para evitar isso coloquei da seguinte forma, If sqlReader.Read() Then lblTeste.Text = sqlReader.IsDBNull(0) End If Mas assim quando existem valores na Label o resultado é true ou false. Como consigo contronar este problema?
nelsonr Posted February 24, 2014 at 03:06 PM Report #546480 Posted February 24, 2014 at 03:06 PM Será algo assim; If sqlReader.Read() Then If Not sqlReader.IsDBNull(0) Then lblTeste.Text = sqlReader.GetInt32(0).ToString() End if End If 1 Report
ferreira12 Posted February 24, 2014 at 03:19 PM Author Report #546482 Posted February 24, 2014 at 03:19 PM Obrigado. funcionou
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now