Click here to Skip to main content
15,564,470 members
Home / Discussions / C#
   

C#

 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
bigjoe11a30-May-09 10:59
bigjoe11a30-May-09 10:59 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
Henry Minute30-May-09 11:43
Henry Minute30-May-09 11:43 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
bigjoe11a30-May-09 12:31
bigjoe11a30-May-09 12:31 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
Henry Minute30-May-09 12:52
Henry Minute30-May-09 12:52 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
bigjoe11a30-May-09 13:03
bigjoe11a30-May-09 13:03 
QuestionUpdating changings back to DB from DataGridView Pin
WinSolution30-May-09 4:11
WinSolution30-May-09 4:11 
AnswerRe: Updating changings back to DB from DataGridView Pin
Henry Minute30-May-09 5:12
Henry Minute30-May-09 5:12 
AnswerRe: Updating changings back to DB from DataGridView Pin
I Believe In GOD30-May-09 11:08
I Believe In GOD30-May-09 11:08 
Hi , if you want to save datagrid back to SQL database then there is a very simple rules :

- every table must have PK ( Exception will rise if don't )

ds = new DataSet("tb");

clsConnect.SqlDa = new SqlDataAdapter("SELECT * FROM tb1 WHERE ID = 2", clsConnect.SqlCon);

clsConnect.SqlCmdBuild = new SqlCommandBuilder(clsConnect.SqlDa);

clsConnect.SqlDa.InsertCommand = clsConnect.SqlCmdBuild.GetInsertCommand();
clsConnect.SqlDa.DeleteCommand = clsConnect.SqlCmdBuild.GetDeleteCommand();
clsConnect.SqlDa.UpdateCommand = clsConnect.SqlCmdBuild.GetUpdateCommand();

clsConnect.SqlDa.Fill(ds , "tb");
dataGridView1.DataSource = ds.Tables[0];
clsConnect.SqlDa.Update(ds.Tables[0]);
ds.Tables[0].AcceptChanges();


I know nothing , I know nothing ...

GeneralRe: Updating changings back to DB from DataGridView Pin
Henry Minute30-May-09 11:51
Henry Minute30-May-09 11:51 
GeneralRe: Updating changings back to DB from DataGridView Pin
I Believe In GOD30-May-09 13:38
I Believe In GOD30-May-09 13:38 
GeneralRe: Updating changings back to DB from DataGridView Pin
WinSolution31-May-09 2:31
WinSolution31-May-09 2:31 
GeneralRe: Updating changings back to DB from DataGridView Pin
I Believe In GOD31-May-09 2:49
I Believe In GOD31-May-09 2:49 
QuestionGet the absolute pix of Html Element Using mshtml Pin
Member 437807730-May-09 4:00
Member 437807730-May-09 4:00 
QuestionPlease help Pin
Etienne_12330-May-09 2:57
Etienne_12330-May-09 2:57 
AnswerRe: Please help Pin
Henry Minute30-May-09 5:02
Henry Minute30-May-09 5:02 
AnswerRe: Please help Pin
I Believe In GOD30-May-09 11:11
I Believe In GOD30-May-09 11:11 
GeneralRe: Please help Pin
Etienne_12331-May-09 0:31
Etienne_12331-May-09 0:31 
GeneralRe: Please help Pin
I Believe In GOD31-May-09 2:54
I Believe In GOD31-May-09 2:54 
Questionservice of Events in C# [modified] Pin
arturw8230-May-09 2:40
arturw8230-May-09 2:40 
AnswerRe: service of Events in C# Pin
Moreno Airoldi30-May-09 8:15
professionalMoreno Airoldi30-May-09 8:15 
Questionwrong behaviour of Text Reader Pin
vishal moharikar30-May-09 2:03
vishal moharikar30-May-09 2:03 
AnswerRe: wrong behaviour of Text Reader Pin
Apocwhen30-May-09 2:49
Apocwhen30-May-09 2:49 
GeneralRe: wrong behaviour of Text Reader Pin
vishal moharikar31-May-09 19:16
vishal moharikar31-May-09 19:16 
AnswerRe: wrong behaviour of Text Reader Pin
Moreno Airoldi30-May-09 8:21
professionalMoreno Airoldi30-May-09 8:21 
GeneralRe: wrong behaviour of Text Reader Pin
Luc Pattyn30-May-09 8:32
sitebuilderLuc Pattyn30-May-09 8:32 

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.