|
Hi,
I need help to convert a excel spreadsheet to a mdb file(access database). Any idea on where I can find help on this, and read more on it. It has to be a vb.net program that reads two 'sheets', and then insert that info into a database. I know how to get the information from excel using a SELECT query and System.Data.OleDb.OleDbConnection.
Any help or suggestions?
|
|
|
|
|
Connecting to Access via code is probably one of the three best documented tasks on the web. All you need to do is call INSERT to insert your data.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The actual question here was how to get the data out of excel in order to insert into access...
to the OP...you might want to do a search for Office PIAs (Primary Interop Assemblies)
Here's a link to get you started: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office10032002.asp
|
|
|
|
|
Then why did he say this:
"I know how to get the information from excel using a SELECT query and System.Data.OleDb.OleDbConnection."
I had no idea you could do this, but if you can, then my advice was correct, and the question was not how to get the data from access, he was already doing that, apparently
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: "I know how to get the information from excel using a SELECT query and System.Data.OleDb.OleDbConnection."
Ok, what I meant was I use OleDbConnection to connect to the excel spreadsheet, and then fill a dataset with the info I get using a select statement.
The problem now is to move this info to a mdf database.
|
|
|
|
|
If you have a dataset, you can use an OleDbConnection to connect to an Access database, and you can insert data using an INSERT statement. There's heaps of info online ( including CP articles ) on using VB.NET to connect to Access.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: Connecting to Access via code is probably one of the three best documented tasks on the web. All you need to do is call INSERT to insert your data.
Hi Christian.
Ok, not to sure what you meant by the comment, basically what I want to do is take a few sheets in an excel spreadsheet, and export them into access, using an web interface and ado.net.
Reason for this terrible job, I cant explain... It's what the client wants
|
|
|
|
|
How to handle unexpected error (50003) in Vb6.0? I have a project in my machine when i compile the project the above error occured.The same project compiled without error in another machine? i have registered the SSTAB component.But in the form SSTAB couldn't visible.How to solve this problem?
|
|
|
|
|
-How to filling a listbox from other page at a web application pages(ASP.NET 2.0)?
Best Regards
Hussein Madani Ghomi
+98-912-5577-832
|
|
|
|
|
Hi,
You can pass an array between pages .....
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
Stop screaming!
You can't use ASP.NET to do that. You have to use client script, e.g. Javascript.
---
b { font-weight: normal; }
|
|
|
|
|
Try adding a module... and then do that trough module.
|
|
|
|
|
Hi all ,
I need some help. Please , someone help me.
I want to connect UniSQL Database within VB.NET.
I use .NET Framework 2( VS 2005 ).
Thankz in advance,
!alien!
|
|
|
|
|
1)In we add a VB.NET file & a ASP.NET page in same application?if so how
will be its compilation?And how can we see the output.
2)What is the difference between a group box and a panel in VB.NET?
3)How can we create our own assemblies in a .NET application
let the noble thought come from every side-Rig Veda
|
|
|
|
|
1) What do you mean by a "VB.NET file"?
2) A group box has a frame.
3) Do you mean a library? Create a Class Library project.
---
b { font-weight: normal; }
|
|
|
|
|
1 - a ASP.NET page IS a VB.NET or C# file. But you can add code files as well, either in dlls, or ( in .NET 2.0 ) to a special folder where they will be compiled as needed.
2 - A panel has a background
3 - By creating a dll project.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi
I have designed an application to send SMS via GSM Modem in vb6.0 using MSCOMM control. Used At commands to send the SMS.
The modem replies me with "OK" message for the common settings At commands ( AT + CMGF = 0 ), but getting the reply as "Error" for the At command (At + CMGS ) which is used to send the SMS.
Please help me out to solve this problem.
I used the following code in my application.
For SENDING SMS
MSComm1.CommPort = 3 (GSM modem is connected on the Port 3)
MSComm1.PortOpen = True
MSComm1.Settings = "115200, n, 8, 1"
' Send an 'AT' command to the phone ----> chr(13) -> carriage return
MSComm1.Output = "AT" & Chr$(13)
'strData$ = MSComm1.Output
' The phone will respond with an 'OK'
timedPause 8
' Set up the phone for a text message
'Do
DoEvents
MSComm1.Output = "AT+CMGF=0" & Chr$(13)
buffer$ = MSComm1.Input
MsgBox buffer$
'Loop Until InStr(buffer$, "OK")
buffer$ = ""
' The phone will respond with an 'OK'
timedPause 8
' Chr(34) --> Double Quotation
'Do
DoEvents
MSComm1.Output = "AT+CMGS= " & Chr(34) & txtDestinationNumber.Text & Chr(34) & Chr$(13) & Chr(10)
MSComm1.Output = txtDataToTransmit.Text & Chr$(26)
buffer$ = MSComm1.Input
MsgBox buffer$
'Loop Until InStr(buffer$, ">")
If buffer$ <> ">" Then
MsgBox "Sending Failed"
MSComm1.PortOpen = False
Exit Sub
End If
buffer$ = ""
MsgBox "SMS Sent"
MSComm1.PortOpen = False
Thanks in advance.
With Love,
Sathish
|
|
|
|
|
hi,
Hope this code solves your problem.
it works in my application.
it sends sms to destination mobile.
MSComm1.Output = "at+cmgf=1" & Chr(34)
do
strbuffer=strbuffer+ MSComm1.Input
while(!instr(strbuffer,0,"OK"))
MSComm1.Output = "at+cmgs=+91323232323" & Chr(34)
strBuffer = strBuffer + MSComm1.Input
MSComm1.Output ="your message" & vbnewline
do
strBuffer = strBuffer + MSComm1.Input
while(!instr(strbuffer,0,"OK"))
hope this works.
Nitin...
Nitin.
|
|
|
|
|
can u make an sample of this and send me to e-mail please.
|
|
|
|
|
|
What does your code look like?
|
|
|
|
|
Can someone help me with the following:
1- I have xml text data that i need to take out invalid characters from.
2- this data contains extraneous characters that i need removed in order to use xmlDocument.LoadXml(str)
3- when this characters are in the str variable i get an XmlException that indicates that there's an invalid character with hex value of 0x0B.
4- how can i remove that character from the string prior to loading it in with xmlDocument.LoadXml(str) ?
5- i am using VS2005
Your help is greatly appreciated....
-- modified at 23:11 Thursday 17th August, 2006
|
|
|
|
|
The string class has a replace method, you would generally call that to remove anything you didn't want in there.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
1- I see.
2- I see.
3- I see.
4- You can use the Replace method of the string class.
5- Good for you.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks to Christian and Guffa.
Below is the solution I was able to come up with...
Public Structure HexReplacement
Public HexCharacter As Char
Public Replacement As String
End Structure
Public Shared Function ConvertHexToChar(ByVal hexValue As String) As Char
Dim convertedChar As Char = Nothing
Try
convertedChar = Chr(Int32.Parse(hexValue, Globalization.NumberStyles.HexNumber))
Catch ex As FormatException
' Error handling here....
Catch ex As ArgumentException
' Error handling here....
End Try
Return convertedChar
End Function
Public Function CleanOutHexValues(ByVal dirtyString As String, ByVal hexReplacements As HexReplacement()) As String
Dim cleanString As String = dirtyString
For Each hr As HexReplacement In hexReplacements
cleanString = cleanString.Replace(hr.HexCharacter, hr.Replacement)
Next
Return cleanString
End Function
Public Sub TestHexCharCleanUp()
Dim hr(1) As HexReplacement
hr(0).HexCharacter = ConvertHexToChar("0b") ' "0b" = or single space.
hr(0).Replacement = ""
Dim dirtyString As String = "Testing the removal of "
MsgBox(CleanOutHexValues(dirtyString, hr))
End Sub
Comments will be greatly appreciated.
|
|
|
|