Click here to Skip to main content
15,912,329 members
Home / Discussions / Database
   

Database

 
GeneralRe: Sql Backup and Restore Pin
Colin Angus Mackay17-Mar-05 6:30
Colin Angus Mackay17-Mar-05 6:30 
GeneralManaged Provider for Oracle Pin
satishrg16-Mar-05 13:26
satishrg16-Mar-05 13:26 
QuestionDTS and Identity column? Pin
devvvy15-Mar-05 14:33
devvvy15-Mar-05 14:33 
QuestionDTS Lookup -- Multiple values? Pin
devvvy15-Mar-05 14:31
devvvy15-Mar-05 14:31 
QuestionHow Do I Pin
Yaakov Davis15-Mar-05 1:33
Yaakov Davis15-Mar-05 1:33 
AnswerRe: How Do I Pin
Yulianto.15-Mar-05 17:08
Yulianto.15-Mar-05 17:08 
GeneralRe: How Do I Pin
Yaakov Davis15-Mar-05 23:55
Yaakov Davis15-Mar-05 23:55 
AnswerRe: How Do I Pin
j1webb18-Mar-05 12:31
j1webb18-Mar-05 12:31 
I can't guarantee all of this code because I pulled it out of one of my programs and then edited it down to what I thought you could use, but I did not test it.

Private Sub loadDatagrid()
boolBeenToGatagrid = True
AddRecords()
strImportfolder = aPath
'this is the folder in which the file resides
strFilename = "selectdata.csv"
'this is the csv file to be imported
strConnstr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + strImportfolder + ";Extensions=asc,csv,tab,txt;Persist Security Info=False;"
Conn = New System.Data.Odbc.OdbcConnection(strConnstr)
da = New System.data.Odbc.OdbcDataAdapter("select * from [" + strFilename + "]", Conn)
Try
ds2.Clear()
da.Fill(ds2, "TableName")
Catch esc As Exception
System.Windows.Forms.MessageBox.Show(esc.Message, "")
End Try
With DataGrid1
.SetDataBinding(ds2, "TableName")
' Set DataGrid Background Color
.GridLineColor = System.Drawing.Color.Black
.BackgroundColor = System.Drawing.Color.Lavender
' Set DataGrid Caption Background Color
.CaptionBackColor = System.Drawing.Color.SlateBlue
' Set DataGrid Caption Foreground Color
.CaptionForeColor = System.Drawing.Color.White 'LemonChiffon
' Set DataGrid Parent Rows Background Color
.ParentRowsBackColor = System.Drawing.Color.Lavender
' Set DataGrid Parent Rows Foreground Color
.ParentRowsForeColor = System.Drawing.Color.SlateBlue
' Set DataGrid Caption Text
.CaptionText = "Study List"
' Clear DataGrid Table Styles
.TableStyles.Clear()
End With

' Set data grid Table Style
Dim tblCrrncMngr As System.Windows.Forms.CurrencyManager = CType(BindingContext(ds2.Tables.Item("TableName")), System.Windows.Forms.CurrencyManager)
Dim TblStyle As New System.Windows.Forms.DataGridTableStyle
With TblStyle
.MappingName = "TableName"
''''''.MappingName = "Studies"
.BackColor = System.Drawing.Color.White
.ForeColor = System.Drawing.Color.Black 'DarkSlateBlue
.GridLineColor = System.Drawing.Color.Black 'MediumSlateBlue
.HeaderBackColor = System.Drawing.Color.Lavender
.HeaderForeColor = System.Drawing.Color.DarkBlue 'MediumSlateBlue
.AlternatingBackColor = System.Drawing.Color.LightGray
.RowHeaderWidth = 10

' Set column styles
With .GridColumnStyles
' Set datagrid ColumnStyle for ID field
.Add(New DataGridPictureColumn)
With .Item(0)
.MappingName = "Wav"
.HeaderText = ""
.Width = 20
.NullText = String.Empty
End With
End With
End With

' Add TableStyle
DataGrid1.TableStyles.Add(TblStyle)
Conn.Close()
ds2.Dispose()
''''''data_table.Dispose()

da.Dispose()
end sub

There is another way to do this without using the QSQL.


AnswerRe: How Do I Pin
-Dr_X-24-Mar-05 14:26
-Dr_X-24-Mar-05 14:26 
GeneralSQL to ACCESS ISSUE Pin
JeyKey15-Mar-05 1:17
JeyKey15-Mar-05 1:17 
QuestionHow to determine whether MSDE is installed or SQL SERVER from Registery Pin
RuchirD14-Mar-05 20:24
RuchirD14-Mar-05 20:24 
GeneralMath Function For SQL Pin
gatorsjf14-Mar-05 6:02
gatorsjf14-Mar-05 6:02 
GeneralRe: Math Function For SQL Pin
Colin Angus Mackay14-Mar-05 6:14
Colin Angus Mackay14-Mar-05 6:14 
GeneralRe: Math Function For SQL Pin
gatorsjf14-Mar-05 6:29
gatorsjf14-Mar-05 6:29 
GeneralRe: Math Function For SQL Pin
Colin Angus Mackay15-Mar-05 0:04
Colin Angus Mackay15-Mar-05 0:04 
GeneralRe: Math Function For SQL Pin
Anonymous15-Mar-05 3:15
Anonymous15-Mar-05 3:15 
Generalinserting data Table Pin
vinu.netguy14-Mar-05 4:36
vinu.netguy14-Mar-05 4:36 
GeneralRe: inserting data Table Pin
Bahadir Cambel14-Mar-05 5:40
Bahadir Cambel14-Mar-05 5:40 
GeneralTransaction problem Pin
Vinicius Pontes14-Mar-05 3:38
Vinicius Pontes14-Mar-05 3:38 
GeneralRe: Transaction problem Pin
BammBamm17-Mar-05 8:29
BammBamm17-Mar-05 8:29 
GeneralRe: Transaction problem Pin
Vinicius Pontes18-Mar-05 4:27
Vinicius Pontes18-Mar-05 4:27 
GeneralInsert data to dbase table Pin
Axsys13-Mar-05 12:26
Axsys13-Mar-05 12:26 
GeneralConnecting remote SQL server Pin
Yaakov Davis13-Mar-05 4:31
Yaakov Davis13-Mar-05 4:31 
GeneralRe: Connecting remote SQL server Pin
Colin Angus Mackay13-Mar-05 6:03
Colin Angus Mackay13-Mar-05 6:03 
GeneralRe: Connecting remote SQL server Pin
Yaakov Davis13-Mar-05 6:50
Yaakov Davis13-Mar-05 6:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.