Hi to all.
I use Q2 2009 version.
I have this simple table on MS SQL2005:
CREATE TABLE [dbo].[CondizioniPagamento](
[id_CondizionePagamento] [int] IDENTITY(1,1) NOT NULL,
[txt_Codice] [varchar](100) NOT NULL,
[txt_Descrizione] [varchar](100) NOT NULL,
[fl_DfFm] [bit] NOT NULL,
[fl_AnnoCommerciale] [bit] NOT NULL,
[n_DistanzaRata1] [int] NOT NULL,
[n_DistanzaAltreRate] [int] NOT NULL,
CONSTRAINT [PK_CondizionePagamento] PRIMARY KEY CLUSTERED
(
[id_CondizionePagamento] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
with this values:
id_CondizionePagamento xt_Codice txt_Descrizione fl_DfFm fl_AnnoCommerciale n_DistanzaRata1 n_DistanzaAltreRate
1 Cd1 Condizione 1 True True 60 30
2 Cd2 Condizione 2 True False 30 30
If I Use this view for load the RadGridView it's all ok:
SELECT id_CondizionePagamento AS CodiceInterno, txt_Codice AS Codice, txt_Descrizione AS Descrizione, fl_DfFm AS DF,
fl_AnnoCommerciale AS [Anno Commerciale], n_DistanzaRata1 AS [Rata 1], n_DistanzaAltreRate AS [Altre Rate]
FROM dbo.CondizioniPagamento
but if i change [Anno Commerciale] to [Anno Comm.] the colum if always false (not cheked)
SELECT id_CondizionePagamento AS CodiceInterno, txt_Codice AS Codice, txt_Descrizione AS Descrizione, fl_DfFm AS DF,
fl_AnnoCommerciale AS [Anno Comm.], n_DistanzaRata1 AS [Rata 1], n_DistanzaAltreRate AS [Altre Rate]
FROM dbo.CondizioniPagamento
Second problem:
If I change the name of the last field, integer, from [Altre Rate] to [Altre Rate.] (only for example) the colum is always empty
I use this code for to load the radgrid
Private Sub ElencoCarica()
Dim Ds As DataSet = getDataSet()
If Ds Is Nothing Then Return
If Ds.Tables.Count < 1 Then Return
RadGridView1.Enabled = True
RadGridView1.DataSource = Ds.Tables(0)
With RadGridView1
For Each colonna As GridViewDataColumn In .Columns
If colonna.FieldName.ToLower.StartsWith("codiceinterno") Then
colonna.IsVisible = False
End If
If colonna.DataType.Name = "DateTime" Then
colonna.FormatString = "{0:dd/MM/yyyy}"
End If
Next
End With
RadGridView1.Show()
End Sub
Private Function getDataSet() As DataSet
getDataSet = New DataSet
If _Query.Length = 0 Then Exit Function
Try
Dim Comando As New SqlClient.SqlCommand(_Query, _SqlConnection)
Dim Da As New SqlClient.SqlDataAdapter(Comando)
Da.Fill(getDataSet)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
End Function
Regards
Giovanni