Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
AnswerRe: Show Multiparty Images on one form Pin
Paw Jershauge18-Sep-13 20:52
Paw Jershauge18-Sep-13 20:52 
AnswerRe: Show Multiparty Images on one form Pin
Pete O'Hanlon18-Sep-13 21:11
mvePete O'Hanlon18-Sep-13 21:11 
QuestionDB2 Connection for Visual Studio Express 2010 Pin
Chris-Za18-Sep-13 2:18
Chris-Za18-Sep-13 2:18 
SuggestionRe: DB2 Connection for Visual Studio Express 2010 Pin
Richard MacCutchan18-Sep-13 2:48
mveRichard MacCutchan18-Sep-13 2:48 
GeneralRe: DB2 Connection for Visual Studio Express 2010 Pin
Chris-Za22-Sep-13 8:50
Chris-Za22-Sep-13 8:50 
GeneralRe: DB2 Connection for Visual Studio Express 2010 Pin
Richard MacCutchan22-Sep-13 21:21
mveRichard MacCutchan22-Sep-13 21:21 
AnswerRe: DB2 Connection for Visual Studio Express 2010 Pin
Eddy Vluggen18-Sep-13 6:46
professionalEddy Vluggen18-Sep-13 6:46 
QuestionPlease help me here, I need to insert data from datagridview to ms access table, and I keep getting an error that says the insert into statement contains the following unknown field name : 'Username',please help me fix this.thanks Pin
katlegoM17-Sep-13 10:41
katlegoM17-Sep-13 10:41 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;

namespace EmployeeAttendanceRegister
{
public partial class SignIN : Form
{
public SignIN()
{
InitializeComponent();
}

public OleDbConnection GetsqlCon()
{
string connstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:/Users/game/Desktop/3rd year/2nd Semester/INYM 328/EmployeeAttendanceRegister/EmployeeAttendanceRegister/EmployeeAttendanceRegister.accdb";
OleDbConnection mycon = new OleDbConnection(connstring);
mycon.Open();
return mycon;
}

public void getComm(string connstring1)
{
OleDbConnection sqlcon = this.GetsqlCon();
OleDbCommand sqlcomm = new OleDbCommand(connstring1, sqlcon);
sqlcomm.ExecuteNonQuery();
sqlcomm.Dispose();
sqlcon.Close();
sqlcon.Dispose();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
string col1 = dataGridView1[0, dataGridView1.CurrentCell.RowIndex].Value.ToString();
string col2 = dataGridView1[1, dataGridView1.CurrentCell.RowIndex].Value.ToString();
string col3 = dataGridView1[2, dataGridView1.CurrentCell.RowIndex].Value.ToString();
string col4 = dataGridView1[3, dataGridView1.CurrentCell.RowIndex].Value.ToString();
string col5 = dataGridView1[4, dataGridView1.CurrentCell.RowIndex].Value.ToString();
string col6 = dataGridView1[5, dataGridView1.CurrentCell.RowIndex].Value.ToString();
string col7 = dataGridView1[6, dataGridView1.CurrentCell.RowIndex].Value.ToString();


string insert_sql = "INSERT INTO Attendance(Username,Lastname,Firstname,Cellnumber,Officenumber,DepartmentName,Passwrd) VALUES('" + col1 + "','" + col2 + "','" + col3 + "','" + col4 + "','" + col5 + "','" + col6 + "','" + col7 + "')";

this.getComm(insert_sql);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

}
AnswerRe: Please help me here, I need to insert data from datagridview to ms access table, and I keep getting an error that says the insert into statement contains the following unknown field name : 'Username',please help me fix this.thanks Pin
Dave Kreskowiak17-Sep-13 10:54
mveDave Kreskowiak17-Sep-13 10:54 
GeneralRe: Please help me here, I need to insert data from datagridview to ms access table, and I keep getting an error that says the insert into statement contains the following unknown field name : 'Username',please help me fix this.thanks Pin
katlegoM17-Sep-13 10:57
katlegoM17-Sep-13 10:57 
AnswerRe: Please help me here, I need to insert data from datagridview to ms access table, and I keep getting an error that says the insert into statement contains the following unknown field name : 'Username',please help me fix this.thanks Pin
Eddy Vluggen17-Sep-13 11:00
professionalEddy Vluggen17-Sep-13 11:00 
GeneralRe: Please help me here, I need to insert data from datagridview to ms access table, and I keep getting an error that says the insert into statement contains the following unknown field name : 'Username',please help me fix this.thanks Pin
Dholakiya Ankit18-Sep-13 2:22
Dholakiya Ankit18-Sep-13 2:22 
AnswerRe: Please help me here, I need to insert data from datagridview to ms access table, and I keep getting an error that says the insert into statement contains the following unknown field name : 'Username',please help me fix this.thanks Pin
katlegoM18-Sep-13 8:10
katlegoM18-Sep-13 8:10 
Questionerror on receive data from seril port Pin
omid32116-Sep-13 21:08
omid32116-Sep-13 21:08 
AnswerRe: error on receive data from seril port Pin
Abhinav S16-Sep-13 22:21
Abhinav S16-Sep-13 22:21 
GeneralRe: error on receive data from seril port Pin
omid32117-Sep-13 2:20
omid32117-Sep-13 2:20 
GeneralRe: error on receive data from seril port Pin
Dave Kreskowiak17-Sep-13 8:46
mveDave Kreskowiak17-Sep-13 8:46 
QuestionIIS hosted site not working properly in Integrated Mode but working fine in Classic Mode? Pin
Rajesh_DotNet16-Sep-13 19:19
professionalRajesh_DotNet16-Sep-13 19:19 
AnswerRe: IIS hosted site not working properly in Integrated Mode but working fine in Classic Mode? Pin
Richard MacCutchan16-Sep-13 20:44
mveRichard MacCutchan16-Sep-13 20:44 
AnswerRe: IIS hosted site not working properly in Integrated Mode but working fine in Classic Mode? Pin
Abhinav S18-Sep-13 18:54
Abhinav S18-Sep-13 18:54 
QuestionCalculate the date of the previous and next 2 Wednesdays Pin
Member 416962816-Sep-13 5:55
Member 416962816-Sep-13 5:55 
AnswerRe: Calculate the date of the previous and next 2 Wednesdays Pin
Richard MacCutchan16-Sep-13 6:47
mveRichard MacCutchan16-Sep-13 6:47 
AnswerRe: Calculate the date of the previous and next 2 Wednesdays Pin
BillWoodruff16-Sep-13 7:13
professionalBillWoodruff16-Sep-13 7:13 
AnswerRe: Calculate the date of the previous and next 2 Wednesdays Pin
PIEBALDconsult16-Sep-13 13:59
mvePIEBALDconsult16-Sep-13 13:59 
GeneralRe: Calculate the date of the previous and next 2 Wednesdays Pin
Richard MacCutchan16-Sep-13 20:43
mveRichard MacCutchan16-Sep-13 20:43 

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.