Click here to Skip to main content
15,916,378 members
Home / Discussions / C#
   

C#

 
Questionchange TableLayoutPanel RowCount before Custom Control Initialization? Pin
Lyon Sun28-Oct-09 23:11
Lyon Sun28-Oct-09 23:11 
QuestionVideo Open & Play using Media Player in C# done but some problem Pin
asimkhatri28-Oct-09 21:28
asimkhatri28-Oct-09 21:28 
AnswerRe: Video Open & Play using Media Player in C# done but some problem Pin
Christian Graus28-Oct-09 21:33
protectorChristian Graus28-Oct-09 21:33 
GeneralRe: Video Open & Play using Media Player in C# done but some problem Pin
ragnaroknrol29-Oct-09 4:43
ragnaroknrol29-Oct-09 4:43 
AnswerRe: Video Open & Play using Media Player in C# done but some problem Pin
ragnaroknrol29-Oct-09 4:53
ragnaroknrol29-Oct-09 4:53 
QuestionPDF conversion issue Pin
Santhosh Sebastian Mattathil28-Oct-09 21:25
Santhosh Sebastian Mattathil28-Oct-09 21:25 
AnswerRe: PDF conversion issue Pin
Christian Graus28-Oct-09 21:32
protectorChristian Graus28-Oct-09 21:32 
GeneralRe: PDF conversion issue Pin
Santhosh Sebastian Mattathil28-Oct-09 21:39
Santhosh Sebastian Mattathil28-Oct-09 21:39 
GeneralRe: PDF conversion issue Pin
Christian Graus28-Oct-09 22:03
protectorChristian Graus28-Oct-09 22:03 
GeneralRe: PDF conversion issue Pin
hb5213421429-Oct-09 9:06
hb5213421429-Oct-09 9:06 
AnswerRe: PDF conversion issue Pin
aashish patidar6-Jul-10 3:53
aashish patidar6-Jul-10 3:53 
QuestionDll File Pin
viciouskinid28-Oct-09 19:53
viciouskinid28-Oct-09 19:53 
AnswerRe: Dll File Pin
N a v a n e e t h28-Oct-09 20:00
N a v a n e e t h28-Oct-09 20:00 
GeneralRe: Dll File Pin
viciouskinid28-Oct-09 20:35
viciouskinid28-Oct-09 20:35 
GeneralRe: Dll File Pin
Christian Graus28-Oct-09 20:37
protectorChristian Graus28-Oct-09 20:37 
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 

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.