vb net devexpress grid data bind from sqlserver

Önce Forma bir adet GridControl ekle   sonra forma tıkla ve aşağıdaki gibi olsun




Imports System.Data.SqlClient
Imports System.IO
Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim Reader As StreamReader = File.OpenText("sql.txt")
        Dim FileText As String = Reader.ReadToEnd()
        Reader.Close()
        MemoEdit1.Text = FileText

        Dim connectionString As String = "Data Source=KLCTRCK;Initial Catalog=LKSDB;User ID=semsem;Password=xaaxpass"
        Dim sql As String = MemoEdit1.Text
        Dim connection As New SqlConnection(connectionString)
        Dim dataadapter As New SqlDataAdapter(sql, connection)
        Dim ds As New DataSet()
        connection.Open()
        dataadapter.Fill(ds, "Firma")
        connection.Close()

        GridControl1.DataSource = ds
        GridControl1.DataMember = "Firma"

        GridView1.OptionsView.ColumnAutoWidth = False 'Gridviewei otomatik genişlik ayarı
        GridView1.OptionsView.BestFitMaxRowCount = -1
        GridView1.BestFitColumns()

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        'xls olarak kaydet
        SaveFileDialog1.Filter = "XLS Files (*.xls*)|*.xls"
        If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK _
        Then
            GridControl1.ExportToXls(SaveFileDialog1.FileName)
        End If
    End Sub
End Class



visual basic read two lines from text file

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim fileReader As System.IO.StreamReader
        fileReader =
        My.Computer.FileSystem.OpenTextFileReader("C:\Users\Digikey\Desktop\MyApplication6\testfile.txt")
        Dim stringReader1, stringReader2 As String




        stringReader1 = fileReader.ReadLine()
        stringReader2 = fileReader.ReadLine()
        MsgBox("The first line of the file is " & stringReader1)
        MsgBox("The second line of the file is " & stringReader2)
    End Sub
End Class



CXGRID AUTOGETCOLUMNS VE FOOTER

        cxGrid1DBTableView1.BeginUpdate;
         cxGrid1DBTableView1.ClearItems;
          cxGrid1DBTableView1.DataController.CreateAllItems;
          cxGrid1DBTableView1.EndUpdate;

FOOTER
ÖNCE CXGRIDIN USTUNDEN CUSTOMIZE VE ADDA BAS
SONRA VIEWSDEN SOLDAKINE TIKLA VE EDIT VIEW LAYOUT YAP VE COLUMNA SAG TIKLA FOOTERA TIKLA OK DE VE SAGDAKI CXGRID1DBTABLEVIEW1COLUMNA TIKLA VE DELETE BAS

 cxGrid1DBTableView1.Columns[0].Summary.FooterKind:=skCount;

cxGrid1DBTableView1.ApplyBestFit();