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

C#

 
AnswerRe: Dll File Pin
Christian Graus28-Oct-09 20:27
protectorChristian Graus28-Oct-09 20:27 
GeneralRe: Dll File Pin
viciouskinid28-Oct-09 20:34
viciouskinid28-Oct-09 20:34 
GeneralRe: Dll File Pin
Christian Graus28-Oct-09 20:36
protectorChristian Graus28-Oct-09 20:36 
GeneralRe: Dll File Pin
viciouskinid28-Oct-09 20:40
viciouskinid28-Oct-09 20:40 
QuestionHow to get the child window position embeded in another window? Pin
ritz123428-Oct-09 19:07
ritz123428-Oct-09 19:07 
AnswerRe: How to get the child window position embeded in another window? Pin
Christian Graus28-Oct-09 20:28
protectorChristian Graus28-Oct-09 20:28 
Questionread data from excel Pin
TAFIN28-Oct-09 19:04
TAFIN28-Oct-09 19:04 
AnswerRe: read data from excel Pin
amaankhan28-Oct-09 19:17
amaankhan28-Oct-09 19:17 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.IO;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
static OleDbConnection con;
//static OleDbCommand cmd;

public Form1()
{
InitializeComponent();

Connect();

}

DataSet ds = new DataSet();
DataTable dt = new DataTable();

private bool Connect()
{
string DB_Path= @"E:\Office Project\salary project\AttendanceSummary.xls";
string Con_Str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DB_Path + ";Extended Properties=\"Excel 8.0;HDR=No;IMEX=1\";";
con = new OleDbConnection(Con_Str);
con.Open();
//string query = "SELECT SNO, ECODE, NAME, PRESENT, ABSENT, OFF, LEAVE, LWP, OTHOURS FROM [AttendanceSummary$]";
string query = "SELECT * FROM [AttendanceSummary$]";
OleDbDataAdapter oda = new OleDbDataAdapter(query, con);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
oda.Fill(ds);

ds.Tables.Add(dt);

string n = ds.Tables[0].Columns[0].ToString();
MessageBox.Show(n);


for (int i = 1; i < ds.Tables [0].Rows .Count ; i++)
{
string result = (ds.Tables[0].Rows[i][ds.Tables [0].Columns [0].ToString ()]).ToString();
comboBox1.Items.Add(result);

}

//DataSet ds = new DataSet();
// DataTable dt = new DataTable();
dataGridView1.DataSource = ds.Tables[0];
dataGridView1.Update();

if (con.State == ConnectionState.Open)
{
MessageBox.Show("Connected");
return true;

}
else
return false;

//// oda.Dispose();
// con.Close();

}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
//ds.Tables.Add(dt);
int index = comboBox1.SelectedIndex +1 ;

textBox1 .Text = (ds.Tables[0].Rows[index][ds.Tables[0].Columns[2].ToString()]).ToString();

}


}

/////////// Hope this will help u......... best of luck..... thank you
GeneralRe: read data from excel Pin
TAFIN28-Oct-09 20:02
TAFIN28-Oct-09 20:02 
GeneralRe: read data from excel Pin
amaankhan28-Oct-09 22:00
amaankhan28-Oct-09 22:00 
QuestionOff-line Documentation Download? Pin
miss YY28-Oct-09 18:53
miss YY28-Oct-09 18:53 
AnswerRe: Off-line Documentation Download? Pin
Christian Graus28-Oct-09 20:36
protectorChristian Graus28-Oct-09 20:36 
GeneralRe: Off-line Documentation Download? Pin
miss YY28-Oct-09 21:11
miss YY28-Oct-09 21:11 
GeneralRe: Off-line Documentation Download? Pin
EliottA29-Oct-09 3:19
EliottA29-Oct-09 3:19 
GeneralRe: Off-line Documentation Download? Pin
Eddy Vluggen29-Oct-09 11:12
professionalEddy Vluggen29-Oct-09 11:12 
Questiontree view Pin
Member 59031028-Oct-09 17:38
Member 59031028-Oct-09 17:38 
AnswerRe: tree view Pin
miss YY28-Oct-09 18:56
miss YY28-Oct-09 18:56 
QuestionClient/Server and browser/Server Pin
wangzhenguo28-Oct-09 16:54
wangzhenguo28-Oct-09 16:54 
AnswerRe: Client/Server and browser/Server Pin
Christian Graus28-Oct-09 17:00
protectorChristian Graus28-Oct-09 17:00 
Questionerror simulation Pin
darthluke28-Oct-09 13:05
darthluke28-Oct-09 13:05 
Questiontranslating on-screen width to printed width Pin
TimWallace28-Oct-09 10:00
TimWallace28-Oct-09 10:00 
AnswerRe: translating on-screen width to printed width Pin
Henry Minute28-Oct-09 10:12
Henry Minute28-Oct-09 10:12 
GeneralRe: translating on-screen width to printed width Pin
TimWallace28-Oct-09 11:07
TimWallace28-Oct-09 11:07 
QuestionGeneric Collection vs ArrayList Pin
Kevin Marois28-Oct-09 9:23
professionalKevin Marois28-Oct-09 9:23 
AnswerRe: Generic Collection vs ArrayList Pin
Henry Minute28-Oct-09 9:45
Henry Minute28-Oct-09 9:45 

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.