Click here to Skip to main content
15,907,497 members
Home / Discussions / Database
   

Database

 
AnswerRe: database question Pin
Colin Angus Mackay1-Aug-06 23:04
Colin Angus Mackay1-Aug-06 23:04 
QuestionAdding Row to Access database table Pin
dsovino1-Aug-06 6:44
dsovino1-Aug-06 6:44 
AnswerRe: Adding Row to Access database table Pin
Stephen McGuire2-Aug-06 11:11
Stephen McGuire2-Aug-06 11:11 
GeneralRe: Adding Row to Access database table Pin
dsovino3-Aug-06 12:41
dsovino3-Aug-06 12:41 
GeneralRe: Adding Row to Access database table Pin
Stephen McGuire3-Aug-06 14:23
Stephen McGuire3-Aug-06 14:23 
QuestionRe: Adding Row to Access database table Pin
dsovino7-Aug-06 6:16
dsovino7-Aug-06 6:16 
AnswerRe: Adding Row to Access database table Pin
Stephen McGuire8-Aug-06 2:43
Stephen McGuire8-Aug-06 2:43 
JokeRe: Adding Row to Access database table Pin
dsovino8-Aug-06 4:01
dsovino8-Aug-06 4:01 
Ooo yes. Last night while reading i found the answer as well.

I just used 'string' instead of string. Numeric values without any characters. I'll keep in mind the # for date values in the future.

thanks a lot for your help. I was stuck at least 1 week for this, and if it wasn't for your help i'll still be trying to use the dataset designer or whatever....

Here's the working code down below. I think it's the easiest way to add rows to a Access database in C#. No need for components!!

peace!!!!!

Smile | :)

--------------------------------------------------------------------------------------

try
{
string source = "Provider=Microsoft.JET.OLEDB.4.0;";
source += "data source=D:\\tesis\\Importar Archivo\\Importando\\Importando\\bin\\radio.mdb;";

OleDbConnection conexion = new OleDbConnection(source);
OleDbCommand comando = new OleDbCommand();

string auxsql = "INSERT INTO archivo (archivo, [ruta archivo], formato, tamaño, muestreo, bitrate,
canales, duracionSeg, [tipo de audio]) ";

auxsql += "VALUES ('" + Archivo + "', '" + path + "', 'desconocido'," + tamano.ToString() + ", " +
muestreo + ", " + auxbitrate + ", " + canales + ", " + duracionms + ", '" + cbTipoAudio.Text +
"')";

comando =new OleDbCommand(auxsql,conexion);
conexion.Open();

comando.ExecuteNonQuery();
conexion.Close();

MessageBox.Show("Update successful");
}

catch (System.Exception ex)
{
MessageBox.Show("Update failed:\r\n"+ex.ToString());
}








daniel kiweed
GeneralRe: Adding Row to Access database table Pin
Stephen McGuire8-Aug-06 7:19
Stephen McGuire8-Aug-06 7:19 
QuestionSychronization in C# Pin
Rabbit171-Aug-06 5:22
Rabbit171-Aug-06 5:22 
AnswerRe: Sychronization in C# Pin
Ennis Ray Lynch, Jr.1-Aug-06 10:39
Ennis Ray Lynch, Jr.1-Aug-06 10:39 
GeneralRe: Sychronization in C# Pin
Rabbit171-Aug-06 12:49
Rabbit171-Aug-06 12:49 
Generalnope Pin
Ennis Ray Lynch, Jr.1-Aug-06 18:27
Ennis Ray Lynch, Jr.1-Aug-06 18:27 
QuestionProblems updating a dataset Pin
newbjohny1-Aug-06 4:16
newbjohny1-Aug-06 4:16 
AnswerRe: Problems updating a dataset Pin
Paul Brower3-Aug-06 10:50
Paul Brower3-Aug-06 10:50 
GeneralRe: Problems updating a dataset Pin
newbjohny4-Aug-06 0:33
newbjohny4-Aug-06 0:33 
QuestionHow to restore records from table which is dropped. Pin
Abhishek Joshi1-Aug-06 2:58
Abhishek Joshi1-Aug-06 2:58 
AnswerRe: How to restore records from table which is dropped. Pin
ToddHileHoffer1-Aug-06 3:05
ToddHileHoffer1-Aug-06 3:05 
QuestionHow to retrieve records from a ADODB with c# Pin
VanEtienne1-Aug-06 2:57
VanEtienne1-Aug-06 2:57 
AnswerRe: creating special relations between datatables Pin
ToddHileHoffer1-Aug-06 2:52
ToddHileHoffer1-Aug-06 2:52 
GeneralRe: creating special relations between datatables Pin
yiwpyos17-Aug-06 23:45
yiwpyos17-Aug-06 23:45 
QuestionFirewall problem Pin
johan31311-Aug-06 1:54
johan31311-Aug-06 1:54 
QuestionAccessing 2 databases [modified] Pin
mcgann1-Aug-06 1:01
mcgann1-Aug-06 1:01 
AnswerRe: Accessing 2 databases Pin
ToddHileHoffer1-Aug-06 3:02
ToddHileHoffer1-Aug-06 3:02 
QuestionInsert multiple values through Trigger Pin
DineshSharma1-Aug-06 0:05
DineshSharma1-Aug-06 0:05 

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.