Click here to Skip to main content
15,885,757 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionconnection database use ado.net in mvc Pin
Nguyen Jay13-Jan-15 5:18
Nguyen Jay13-Jan-15 5:18 
AnswerRe: connection database use ado.net in mvc Pin
Afzaal Ahmad Zeeshan13-Jan-15 10:23
professionalAfzaal Ahmad Zeeshan13-Jan-15 10:23 
QuestionQuiz for Certification Pin
Member 1061043212-Jan-15 17:46
Member 1061043212-Jan-15 17:46 
SuggestionRe: Quiz for Certification Pin
Richard MacCutchan12-Jan-15 21:47
mveRichard MacCutchan12-Jan-15 21:47 
AnswerRe: Quiz for Certification Pin
Anurag Gandhi15-Jan-15 5:39
professionalAnurag Gandhi15-Jan-15 5:39 
QuestionUsing a SERVICE Reference vs WEB Reference, with endpoint behavior to alter SOAP request header Pin
jkirkerx12-Jan-15 11:39
professionaljkirkerx12-Jan-15 11:39 
GeneralI'm reformulating my question here Pin
jkirkerx12-Jan-15 12:33
professionaljkirkerx12-Jan-15 12:33 
Questioninserting data in an excel file using ASP.NET (VB) Pin
John_Reese12-Jan-15 4:54
John_Reese12-Jan-15 4:54 
Hi guys,

I have a project am working on, I have to fill an excel file with data from textboxes, radiobutton lists, etc ..
the excel file must not be opened for the user, it will be used as a database file.
I have 6 columns to fill.
each time the user clicks the button, all data must be added to the first empty row in the excel file.

the problem is, I tried several ideas (connecting database using SQL commands, ODBC, ...) and everytime I encounter a different error, or simply nothing happens .. errors of course are when running the project in the internet browser, so no compilation errors.
the excel file is an EXCEL 2010, the version of VS is 2008.

here's one of the codes I used, for this code I got an error about ISAM driver not found :

Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.Data.Common
Imports System.IO

Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click
        If IsDate(TextBox3.Text) = False Or TextBox3.Text = "" Or TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox4.Text = "" Or RadioButtonList1.SelectedIndex = -1 Then
            MsgBox("Veuillez vérifier les champs d'écriture.", MsgBoxStyle.OkOnly, "Champs manquants ou invalides")
            Exit Sub
        End If

        Try
            Dim MyConnection As System.Data.OleDb.OleDbConnection
            Dim myCommand As New System.Data.OleDb.OleDbCommand
            Dim sql As String = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=D:\Data\Excel_File.xlsx;Extended Properties=Excel 12.0 Xml;HDR=YES;")
            MyConnection.Open()
            myCommand.Connection = MyConnection
            sql = "INSERT INTO [feuil1$] (Opérateur, Type_Heures, Date, Heures_Entrée, Heures_Sortie, Tâches) VALUES (@Opérateur, @Type_Heures, @Date, @Heures_Entrée, @Heures_Sortie, @Tâches)"
myCommand.Parameters.AddWithValue("@Opérateur", Label4.Text)
    myCommand.Parameters.AddWithValue("@Type_Heures", RadioButtonList1Text)
    myCommand.Parameters.AddWithValue("@Date", TextBox3.Text)
    myCommand.Parameters.AddWithValue("@Heures_Entrée", TextBox1.Text)
    myCommand.Parameters.AddWithValue("@Heures_Sortie", TextBox2.Text)
myCommand.Parameters.AddWithValue("@Tâches", TextBox4.Text)
            myCommand.CommandText = sql
            myCommand.ExecuteNonQuery()
            MyConnection.Close()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
        MsgBox("Row Added ")

End Sub

AnswerRe: inserting data in an excel file using ASP.NET (VB) Pin
John_Reese12-Jan-15 5:29
John_Reese12-Jan-15 5:29 
QuestionChanging Resource files programmatically in ASP.Net 4.5 Pin
meeram3912-Jan-15 0:48
professionalmeeram3912-Jan-15 0:48 
AnswerRe: Changing Resource files programmatically in ASP.Net 4.5 Pin
Afzaal Ahmad Zeeshan12-Jan-15 4:26
professionalAfzaal Ahmad Zeeshan12-Jan-15 4:26 
QuestionNeed to understand a signalr chatting code Pin
Tridip Bhattacharjee11-Jan-15 23:49
professionalTridip Bhattacharjee11-Jan-15 23:49 
AnswerRe: Need to understand a signalr chatting code Pin
deepankarbhatnagar12-Jan-15 1:13
professionaldeepankarbhatnagar12-Jan-15 1:13 
GeneralRe: Need to understand a signalr chatting code Pin
Tridip Bhattacharjee12-Jan-15 20:40
professionalTridip Bhattacharjee12-Jan-15 20:40 
AnswerRe: Need to understand a signalr chatting code Pin
Dar Brett13-Jan-15 3:06
Dar Brett13-Jan-15 3:06 
QuestionGIF image as progressbar using AJAX modalpopupExtender Pin
sudevsu8-Jan-15 5:17
sudevsu8-Jan-15 5:17 
AnswerRe: GIF image as progressbar using AJAX modalpopupExtender Pin
jkirkerx8-Jan-15 7:30
professionaljkirkerx8-Jan-15 7:30 
GeneralRe: GIF image as progressbar using AJAX modalpopupExtender Pin
sudevsu8-Jan-15 10:21
sudevsu8-Jan-15 10:21 
GeneralRe: GIF image as progressbar using AJAX modalpopupExtender Pin
jkirkerx8-Jan-15 11:49
professionaljkirkerx8-Jan-15 11:49 
AnswerRe: GIF image as progressbar using AJAX modalpopupExtender Pin
Vimalsoft(Pty) Ltd12-Jan-15 20:51
professionalVimalsoft(Pty) Ltd12-Jan-15 20:51 
QuestionIf else condition fails, in VB.net Pin
sudevsu7-Jan-15 8:33
sudevsu7-Jan-15 8:33 
GeneralRe: If else condition fails, in VB.net Pin
PIEBALDconsult7-Jan-15 9:00
mvePIEBALDconsult7-Jan-15 9:00 
GeneralRe: If else condition fails, in VB.net Pin
sudevsu7-Jan-15 9:14
sudevsu7-Jan-15 9:14 
GeneralRe: If else condition fails, in VB.net Pin
sudevsu7-Jan-15 9:42
sudevsu7-Jan-15 9:42 
GeneralRe: If else condition fails, in VB.net Pin
PIEBALDconsult7-Jan-15 9:44
mvePIEBALDconsult7-Jan-15 9:44 

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.