Click here to Skip to main content
15,895,283 members
Home / Discussions / C#
   

C#

 
GeneralRe: CodeDOM passing parameters Pin
xJorDyx23-Jun-08 9:35
xJorDyx23-Jun-08 9:35 
QuestionCan we get program's number line after compiling the source ? Pin
Mohammad Dayyan22-Jun-08 12:59
Mohammad Dayyan22-Jun-08 12:59 
AnswerRe: Can we get program's number line after compiling the source ? Pin
Gareth H22-Jun-08 13:05
Gareth H22-Jun-08 13:05 
AnswerRe: Can we get program's number line after compiling the source ? Pin
Luc Pattyn22-Jun-08 13:18
sitebuilderLuc Pattyn22-Jun-08 13:18 
GeneralRe: Can we get program's number line after compiling the source ? Pin
Mohammad Dayyan23-Jun-08 2:07
Mohammad Dayyan23-Jun-08 2:07 
GeneralRe: Can we get program's number line after compiling the source ? Pin
Luc Pattyn23-Jun-08 2:08
sitebuilderLuc Pattyn23-Jun-08 2:08 
AnswerRe: Can we get program's number line after compiling the source ? Pin
Mohammad Dayyan23-Jun-08 2:48
Mohammad Dayyan23-Jun-08 2:48 
QuestionNewbie Question Pin
kruegersck22-Jun-08 12:59
kruegersck22-Jun-08 12:59 
I am trying to update my Access and I am recieving an Error:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace ProspectorV100
{
public partial class frmProspectMaint : Form
{
OleDbConnection cnADONETConnection = new OleDbConnection();
OleDbDataAdapter daContactsCombo;
OleDbCommandBuilder cbContactsCombo;
DataTable dtContactsCombo = new DataTable();
int row;
long intContactID;

public frmProspectMaint()
{
InitializeComponent();
}

private void frmProspectMaint_Load(object sender, EventArgs e)
{
cnADONETConnection.ConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Prospector\Database\prospect.mdb";
cnADONETConnection.Open();
daContactsCombo =
new OleDbDataAdapter("Select * From Contacts Order by Last_Name", cnADONETConnection);
OleDbCommandBuilder cbContactsCombo = new OleDbCommandBuilder(daContactsCombo);
daContactsCombo.Fill(dtContactsCombo);
this.LoadSearchBox();
}

private void LoadSearchBox()
{
for (int x = 0; x < dtContactsCombo.Rows.Count; x++)
{
tlsSearch.Items.Add(dtContactsCombo.Rows[x]["Last_Name"].ToString() + ", " +
dtContactsCombo.Rows[x]["First_Name"].ToString());
tlsSearch.AutoCompleteCustomSource.Add(dtContactsCombo.Rows[x]["Last_Name"].ToString() + ", " +
dtContactsCombo.Rows[x]["First_Name"].ToString());
}
}

private void frmProspectMaint_FormClosed(object sender, FormClosedEventArgs e)
{
cnADONETConnection.Close();
cnADONETConnection.Dispose();
}

private void tlsSearch_SelectedIndexChanged(object sender, EventArgs e)
{

row = tlsSearch.SelectedIndex;

intContactID = Convert.ToInt32(dtContactsCombo.Rows[row]["Contact_ID"].ToString());
txtFirstName.Text = dtContactsCombo.Rows[row]["First_Name"].ToString();
txtLastName.Text = dtContactsCombo.Rows[row]["Last_Name"].ToString();
txtCompany.Text = dtContactsCombo.Rows[row]["Company_Name"].ToString();
txtJobTitle.Text = dtContactsCombo.Rows[row]["Job_Title"].ToString();
}

private void tlsSave_Click(object sender, EventArgs e)
{
//If there is existing Data Update it
if (row >= 0)
{
dtContactsCombo.Rows[row]["Contact_ID"] = intContactID;
dtContactsCombo.Rows[row]["Last_Name"] = txtLastName.Text;
dtContactsCombo.Rows[row]["First_Name"] = txtFirstName.Text;
dtContactsCombo.Rows[row]["Company_Name"] = txtCompany.Text;
dtContactsCombo.Rows[row]["Job_Title"] = txtJobTitle.Text;
daContactsCombo.Update(dtContactsCombo);
}
}

}
}

As I stated before I am new to C# and any help would be appreciated.
AnswerRe: Newbie Question Pin
Gareth H22-Jun-08 13:03
Gareth H22-Jun-08 13:03 
GeneralRe: Newbie Question Pin
kruegersck22-Jun-08 13:09
kruegersck22-Jun-08 13:09 
GeneralRe: Newbie Question Pin
Christian Graus22-Jun-08 15:12
protectorChristian Graus22-Jun-08 15:12 
GeneralRe: Newbie Question Pin
kruegersck22-Jun-08 16:28
kruegersck22-Jun-08 16:28 
GeneralRe: Newbie Question Pin
Christian Graus22-Jun-08 18:27
protectorChristian Graus22-Jun-08 18:27 
GeneralRe: Newbie Question Pin
kruegersck23-Jun-08 2:58
kruegersck23-Jun-08 2:58 
GeneralRe: Newbie Question Pin
Christian Graus23-Jun-08 11:36
protectorChristian Graus23-Jun-08 11:36 
QuestionDrog and Drop question ? Pin
Mohammad Dayyan22-Jun-08 11:17
Mohammad Dayyan22-Jun-08 11:17 
AnswerRe: Drog and Drop question ? Pin
Christian Graus22-Jun-08 12:20
protectorChristian Graus22-Jun-08 12:20 
GeneralRe: Drog and Drop question ? Pin
Mohammad Dayyan22-Jun-08 12:28
Mohammad Dayyan22-Jun-08 12:28 
GeneralRe: Drog and Drop question ? Pin
Christian Graus22-Jun-08 12:31
protectorChristian Graus22-Jun-08 12:31 
GeneralRe: Drog and Drop question ? Pin
Mohammad Dayyan22-Jun-08 12:39
Mohammad Dayyan22-Jun-08 12:39 
AnswerRe: Drog and Drop question ? Pin
Anthony Mushrow22-Jun-08 14:50
professionalAnthony Mushrow22-Jun-08 14:50 
GeneralRe: Drog and Drop question ? Pin
DaveyM6922-Jun-08 23:18
professionalDaveyM6922-Jun-08 23:18 
QuestionMaking scrol lbox custom controls using compact framework sdk Pin
neilfed222-Jun-08 9:13
neilfed222-Jun-08 9:13 
Answer[Cross Post]Re: Making scrol lbox custom controls using compact framework sdk Pin
Scott Dorman22-Jun-08 10:34
professionalScott Dorman22-Jun-08 10:34 
QuestionHelp. I'm Lost. How to retrieve the selected row information from a DataGridView Pin
TheFoZ22-Jun-08 8:04
TheFoZ22-Jun-08 8:04 

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.