Click here to Skip to main content
15,891,431 members
Home / Discussions / C#
   

C#

 
QuestionProblem in Deployment of Excel Data Reading WebPart developed in C# Pin
khan SharePoint Developer26-Jul-07 23:45
khan SharePoint Developer26-Jul-07 23:45 
QuestionDiscover a Device in C# Pin
Amjath Rahman26-Jul-07 23:43
Amjath Rahman26-Jul-07 23:43 
AnswerRe: Discover a Device in C# Pin
Martin#26-Jul-07 23:54
Martin#26-Jul-07 23:54 
GeneralRe: Discover a Device in C# Pin
Amjath Rahman29-Jul-07 14:51
Amjath Rahman29-Jul-07 14:51 
Questionprinting a complete datagrid having paging and sorting Pin
samparadise26-Jul-07 23:36
samparadise26-Jul-07 23:36 
Questiondatagrid save Pin
csharpgal26-Jul-07 23:16
csharpgal26-Jul-07 23:16 
AnswerRe: datagrid save Pin
Christian Graus27-Jul-07 0:26
protectorChristian Graus27-Jul-07 0:26 
QuestionRe: datagrid save Pin
csharpgal27-Jul-07 1:41
csharpgal27-Jul-07 1:41 
thank you for your reply.
how will i do it, i dont know. i try this code but i can change or add new row at one time.

my present code id like this:


private void button2_Click(object sender, System.EventArgs e)
{
int satir;
satir=dataGrid4.CurrentRowIndex;

if(dG4SatirSay==satir)
{
DataTable tablo;
DataRow kayit;
tablo=alPersOzluk.Tables[0];
kayit=tablo.NewRow();
kayit[1]=dataGrid4[satir,1];

string kaynakGor="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=vt1.mdb";
OleDbConnection baglantiGor=new OleDbConnection(kaynakGor);
baglantiGor.Open();

string gorevAdi=dataGrid4[satir,2].ToString();
string sorguGor="SELECT GorevNo FROM PGorev Where Gorev='"+gorevAdi+"'";
OleDbCommand komutGor=new OleDbCommand(sorguGor,baglantiGor);
OleDbDataReader ordGor= komutGor.ExecuteReader();
ordGor.Read();
kayit[2]=ordGor[0].ToString();

ordGor.Close();
baglantiGor.Close();

kayit[3]=dataGrid4[satir,3];
kayit[4]=dataGrid4[satir,4];
kayit[5]=dataGrid4[satir,5];
kayit[6]=dataGrid4[satir,6];
kayit[7]=dataGrid4[satir,7];
kayit[8]=dataGrid4[satir,8];

string kaynakPrs="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=vt1.mdb";
OleDbConnection baglantiPrs=new OleDbConnection(kaynakPrs);
baglantiPrs.Open();

string sorguPrs=@"Insert Into PersonelOzluk(AdiSoyadi,Gorevi,TelefonNo,Adresi,TCKimlikNo,VergiNo,DogumTarihi,KanGrubu) Values ('"+kayit[1]+"','"+kayit[2]+"','"+kayit[3]+"','"+kayit[4]+"','"+kayit[5]+"','"+kayit[6]+"','"+kayit[7]+"','"+kayit[8]+"')";
OleDbCommand komutPrs=new OleDbCommand(sorguPrs,baglantiPrs);

komutPrs.ExecuteNonQuery();
baglantiPrs.Close();
}
else
{
DataTable tablo;
DataRow kayit;
tablo=alPersOzluk.Tables[0];
kayit=tablo.NewRow();
kayit[0]=dataGrid4[satir,0];
kayit[1]=dataGrid4[satir,1];

string kaynakGor="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=vt1.mdb";
OleDbConnection baglantiGor=new OleDbConnection(kaynakGor);
baglantiGor.Open();

string gorevAdi=dataGrid4[satir,2].ToString();
string sorguGor="SELECT GorevNo FROM PGorev Where Gorev='"+gorevAdi+"'";
OleDbCommand komutGor=new OleDbCommand(sorguGor,baglantiGor);
OleDbDataReader ordGor= komutGor.ExecuteReader();
ordGor.Read();
kayit[2]=ordGor[0].ToString();

ordGor.Close();
baglantiGor.Close();

kayit[3]=dataGrid4[satir,3];
kayit[4]=dataGrid4[satir,4];
kayit[5]=dataGrid4[satir,5];
kayit[6]=dataGrid4[satir,6];
kayit[7]=dataGrid4[satir,7];
kayit[8]=dataGrid4[satir,8];

string kaynakPrs="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=vt1.mdb";
OleDbConnection baglantiPrs=new OleDbConnection(kaynakPrs);
baglantiPrs.Open();

string sorguPrs="Update PersonelOzluk Set AdiSoyadi='"+kayit[1]+"',Gorevi='"+kayit[2]+"',TelefonNo='"+kayit[3]+"',Adresi='"+kayit[4]+"',TCKimlikNo='"+kayit[5]+"',VergiNo='"+kayit[6]+"',DogumTarihi='"+kayit[7]+"',KanGrubu='"+kayit[8]+"' Where PersonelNo="+kayit[0]+"";
OleDbCommand komutPrs=new OleDbCommand(sorguPrs,baglantiPrs);

komutPrs.ExecuteNonQuery();
baglantiPrs.Close();
}
}
QuestionControl inside listbox C# .Net Pin
drweb8626-Jul-07 22:53
drweb8626-Jul-07 22:53 
AnswerRe: Control inside listbox C# .Net Pin
Christian Graus26-Jul-07 23:08
protectorChristian Graus26-Jul-07 23:08 
GeneralRe: Control inside listbox C# .Net Pin
drweb8626-Jul-07 23:32
drweb8626-Jul-07 23:32 
GeneralRe: Control inside listbox C# .Net Pin
Christian Graus26-Jul-07 23:36
protectorChristian Graus26-Jul-07 23:36 
GeneralRe: Control inside listbox C# .Net Pin
drweb8626-Jul-07 23:45
drweb8626-Jul-07 23:45 
QuestionShowing an icon in a gridview (WPF) Pin
Johan Lombaard26-Jul-07 22:51
Johan Lombaard26-Jul-07 22:51 
AnswerRe: Showing an icon in a gridview (WPF) Pin
kubben27-Jul-07 1:42
kubben27-Jul-07 1:42 
Questionconvert to ASCII Pin
Sunshine Always26-Jul-07 22:47
Sunshine Always26-Jul-07 22:47 
AnswerRe: convert to ASCII Pin
Christian Graus26-Jul-07 23:07
protectorChristian Graus26-Jul-07 23:07 
AnswerRe: convert to ASCII Pin
Hari Om Prakash Sharma26-Jul-07 23:09
Hari Om Prakash Sharma26-Jul-07 23:09 
GeneralRe: convert to ASCII Pin
Christian Graus26-Jul-07 23:25
protectorChristian Graus26-Jul-07 23:25 
QuestionEventhandler in C# - How to send parameter Pin
Vikas K.26-Jul-07 22:14
Vikas K.26-Jul-07 22:14 
AnswerRe: Eventhandler in C# - How to send parameter [modified] Pin
Martin#26-Jul-07 22:38
Martin#26-Jul-07 22:38 
GeneralRe: Eventhandler in C# - How to send parameter Pin
Vikas K.26-Jul-07 23:17
Vikas K.26-Jul-07 23:17 
GeneralRe: Eventhandler in C# - How to send parameter Pin
Martin#26-Jul-07 23:19
Martin#26-Jul-07 23:19 
GeneralRe: Eventhandler in C# - How to send parameter Pin
Mike Dimmick27-Jul-07 2:26
Mike Dimmick27-Jul-07 2:26 
GeneralRe: Eventhandler in C# - How to send parameter Pin
Martin#27-Jul-07 2:46
Martin#27-Jul-07 2:46 

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.