Click here to Skip to main content
15,896,557 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Grid and combo box issue redefined Pin
helelark12327-Dec-07 1:16
helelark12327-Dec-07 1:16 
GeneralRe: Grid and combo box issue redefined Pin
BOREC27-Dec-07 1:16
BOREC27-Dec-07 1:16 
Generaldatagridviewcomboboxcolumn selectionbackcolor Pin
helelark12327-Dec-07 0:01
helelark12327-Dec-07 0:01 
GeneralRe: datagridviewcomboboxcolumn selectionbackcolor Pin
KaptinKrunch28-Dec-07 6:41
KaptinKrunch28-Dec-07 6:41 
GeneralRe: datagridviewcomboboxcolumn selectionbackcolor Pin
helelark12328-Dec-07 21:42
helelark12328-Dec-07 21:42 
Generalgenerating a report in .net Pin
sreenivi26-Dec-07 23:50
sreenivi26-Dec-07 23:50 
GeneralRe: generating a report in .net Pin
Paul Conrad30-Dec-07 10:42
professionalPaul Conrad30-Dec-07 10:42 
QuestionHow to import data by character wise from excel to sql server Pin
kamarudeen26-Dec-07 23:03
kamarudeen26-Dec-07 23:03 
Hi,
I hav a code for import data from excel to sql server. This code used to import data totally. That is, already some data in excel imported the whole data to sql server.The code is,


Dim excelConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties=""Excel 8.0;HDR=YES;"""


Dim connection As OleDbConnection = New OleDbConnection(excelConnectionString)
Try
Dim command As OleDbCommand = New OleDbCommand("Select ID,Data FROM [Sheet1$]", connection)
connection.Open()
Dim dr As OleDbDataReader = command.ExecuteReader
Try
Dim sqlConnectionString As String
'= WebConfigurationManager.ConnectionStrings("CampaignEnterpriseConnectionString").ConnectionString
sqlConnectionString = "Data Source=rafik-vzi7iicz1\sa;Initial Catalog=Excel;Integrated Security=True"
Dim con As SqlConnection
con = New SqlConnection(sqlConnectionString)
Dim bulkCopy As SqlBulkCopy = New SqlBulkCopy(sqlConnectionString)
Try
bulkCopy.DestinationTableName = "Exceldata"
bulkCopy.WriteToServer(dr)
Finally
CType(bulkCopy, IDisposable).Dispose()
End Try
Finally
CType(dr, IDisposable).Dispose()
End Try
Catch ex As Exception
Finally
CType(connection, IDisposable).Dispose()
End Try
MsgBox("imported successfully", MsgBoxStyle.Information)

The code is working perfectly.

My problem is, i need to import the data by character wise. That is, suppose i typing some word in excel, the word automatically saved in sql server by character wise.

Any idea Plz tell me.
Suggestions also appreciate.
Plz help me.
AnswerRe: How to import data by character wise from excel to sql server Pin
Dave Kreskowiak27-Dec-07 12:46
mveDave Kreskowiak27-Dec-07 12:46 
GeneralRe: How to import data by character wise from excel to sql server Pin
kamarudeen27-Dec-07 18:29
kamarudeen27-Dec-07 18:29 
GeneralException of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' Pin
phoopwint26-Dec-07 22:04
phoopwint26-Dec-07 22:04 
GeneralRe: Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' Pin
Dave Kreskowiak27-Dec-07 12:45
mveDave Kreskowiak27-Dec-07 12:45 
GeneralI need help from one and all in the VB6 regarding making data in the datagrid editable and then saving that in the database either Access, Oracle or MySQL Pin
Keshav Singh Sunwar26-Dec-07 21:08
Keshav Singh Sunwar26-Dec-07 21:08 
GeneralRe: I need help from one and all in the VB6 ... and then saving that in the database either Access, Oracle or MySQL Pin
Paul Conrad27-Dec-07 7:31
professionalPaul Conrad27-Dec-07 7:31 
GeneralRe: I need help from one and all in the VB6 ... and then saving that in the database either Access, Oracle or MySQL Pin
Keshav Singh Sunwar27-Dec-07 20:24
Keshav Singh Sunwar27-Dec-07 20:24 
GeneralRe: I need help from one and all in the VB6 ... and then saving that in the database either Access, Oracle or MySQL Pin
Paul Conrad28-Dec-07 13:00
professionalPaul Conrad28-Dec-07 13:00 
GeneralRe: I need help from one and all in the VB6 regarding making data in the datagrid editable and then saving that in the database either Access, Oracle or MySQL Pin
Dave Kreskowiak27-Dec-07 12:44
mveDave Kreskowiak27-Dec-07 12:44 
GeneralNeed Help Pin
BOREC26-Dec-07 20:34
BOREC26-Dec-07 20:34 
GeneralRe: Need Help Pin
Colin Angus Mackay27-Dec-07 0:04
Colin Angus Mackay27-Dec-07 0:04 
GeneralRe: Need Help Pin
BOREC27-Dec-07 0:51
BOREC27-Dec-07 0:51 
GeneralRe: Need Help Pin
darkelv27-Dec-07 1:00
darkelv27-Dec-07 1:00 
GeneralRe: Need Help [modified] Pin
BOREC27-Dec-07 1:42
BOREC27-Dec-07 1:42 
GeneralRe: Need Help Pin
Colin Angus Mackay27-Dec-07 2:04
Colin Angus Mackay27-Dec-07 2:04 
GeneralRe: Need Help Pin
BOREC27-Dec-07 2:12
BOREC27-Dec-07 2:12 
GeneralRe: Need Help Pin
leckey27-Dec-07 4:51
leckey27-Dec-07 4:51 

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.