title: How to get nvarchar data from SQL Server database
body: <p>I'd like to get some values from <code>nvarchar</code> column (SQL Server database). My code looks like below:</p>
  
  <pre><code>Dim value1 As String
  
  Dim con2 As New System.Data.SqlClient.SqlConnection
  con2.ConnectionString = "data source=AAA;initial catalog=DWH;integrated security=SSPI;"
  
  con2.Open()
  
  Dim retrieveGSFdata As New System.Data.SqlClient.SqlCommand
  retrieveGSFdata.Connection = con2
  retrieveGSFdata.CommandText = "SELECT * FROM table1"
  
  Dim myGSFdataReader as System.Data.SqlClient.SqlDataReader
  myGSFdataReader = retrieveGSFdata.ExecuteReader()
  
  Dim iteratorGSF As Integer
  iteratorGSF = 0
  
  while(myGSFdataReader.read())
  
      Select Case iteratorGSF
        case 0:
          if myGSFdataReader.IsDBNull(4)
             value1 = 0
          else
             value1 = myGSFdataReader.GetString(4)
          end if
      End Select  
  
      iteratorGSF = iteratorGSF + 1
  
  End while
  
  myGSFdataReader.Close()
  con2.Close()
  </code></pre>
  
  <p>It works fine only when there are numeric values in the column. But in this column are stored variable characters values and this types of values are not being displayed on the page. I don't know what is the reason.</p>
  
  <p>I've tried to use <code>getValue.ToString</code> instead of <code>getString</code> but it doesn't work either.</p>
  
  <p>I'd be grateful for your help.</p>