Click here to Skip to main content
15,915,744 members
Home / Discussions / C#
   

C#

 
QuestionInvoke xsd.exe thru code Pin
nikanth17-Apr-07 5:22
nikanth17-Apr-07 5:22 
AnswerRe: Invoke xsd.exe thru code Pin
kubben17-Apr-07 5:38
kubben17-Apr-07 5:38 
GeneralRe: Invoke xsd.exe thru code Pin
nikanth18-Apr-07 2:39
nikanth18-Apr-07 2:39 
GeneralRe: Invoke xsd.exe thru code Pin
kubben18-Apr-07 2:54
kubben18-Apr-07 2:54 
QuestionApp config files Pin
eliea17-Apr-07 5:18
eliea17-Apr-07 5:18 
AnswerRe: App config files Pin
eliea17-Apr-07 5:19
eliea17-Apr-07 5:19 
QuestionCannot get data saved to my SQL dbase Pin
tvance92917-Apr-07 5:01
tvance92917-Apr-07 5:01 
AnswerRe: Cannot get data saved to my SQL dbase Pin
mdv11321-Apr-07 10:25
mdv11321-Apr-07 10:25 
There are many ways to write data to the db:

With SqlDataAdapter:
FETCH DATA:
SqlConnection con = new SqlConnection( connectionstring);
SqlCommand command = new SqlCommand("select* from table", con);
SqlDataAdapter adapter = new SqlDataAdapter(command);
DataSet set = new DataSet();
adapter.Fill(set);

CHANGE DATA:
//get row to change
DataRow row = set.Select("Columnx = 1");
row("Columnx") = 2;
//Write to DB
adapter.Update(set);
//commit dataset
set.AcceptChanges();

INSERT NEW ROW:
DataRow newrow = set.Tables[0].NewRow();
newrow("Columnx") = x;
newrow("Columny") = y;
set.Tables[0].Rows.Add(newrow);
adapter.Update(set);
set.AcceptChanges();

Connection does not have to be opened nor closed when using adapter.

You can also use direct SQL like so..
SqlConnection con = new SqlConnection( connectionstring);
SqlCommand command = new SqlCommand("insert into table values(1,2) ", con);
con.Open();
command.ExecuteNonQuery();
con.Close();

QuestionCreating a console typewriter-like program Pin
sharpiesharpie17-Apr-07 5:01
sharpiesharpie17-Apr-07 5:01 
AnswerRe: Creating a console typewriter-like program Pin
girm17-Apr-07 5:23
girm17-Apr-07 5:23 
QuestionSerialization issues with .NET Remoting Pin
mmfranke17-Apr-07 4:16
mmfranke17-Apr-07 4:16 
AnswerRe: Serialization issues with .NET Remoting Pin
Pete O'Hanlon17-Apr-07 4:52
mvePete O'Hanlon17-Apr-07 4:52 
GeneralRe: Serialization issues with .NET Remoting Pin
mmfranke17-Apr-07 5:12
mmfranke17-Apr-07 5:12 
GeneralRe: Serialization issues with .NET Remoting Pin
Pete O'Hanlon17-Apr-07 5:20
mvePete O'Hanlon17-Apr-07 5:20 
GeneralRe: Serialization issues with .NET Remoting Pin
mmfranke17-Apr-07 5:50
mmfranke17-Apr-07 5:50 
GeneralRe: Serialization issues with .NET Remoting Pin
Pete O'Hanlon17-Apr-07 9:52
mvePete O'Hanlon17-Apr-07 9:52 
GeneralRe: Serialization issues with .NET Remoting Pin
mmfranke17-Apr-07 9:55
mmfranke17-Apr-07 9:55 
QuestionC# Dynamically Named Array (Or arraylists) Pin
bugg_tb17-Apr-07 3:59
bugg_tb17-Apr-07 3:59 
AnswerRe: C# Dynamically Named Array (Or arraylists) Pin
Martin#17-Apr-07 4:39
Martin#17-Apr-07 4:39 
GeneralRe: C# Dynamically Named Array (Or arraylists) Pin
bugg_tb17-Apr-07 5:28
bugg_tb17-Apr-07 5:28 
GeneralRe: C# Dynamically Named Array (Or arraylists) Pin
Martin#17-Apr-07 5:32
Martin#17-Apr-07 5:32 
AnswerRe: C# Dynamically Named Array (Or arraylists) Pin
Vikram A Punathambekar17-Apr-07 4:47
Vikram A Punathambekar17-Apr-07 4:47 
QuestionUserControl and List Pin
Monty217-Apr-07 3:47
Monty217-Apr-07 3:47 
AnswerRe: UserControl and List Pin
sujithkumarsl17-Apr-07 20:06
sujithkumarsl17-Apr-07 20:06 
GeneralRe: UserControl and List Pin
Monty217-Apr-07 20:19
Monty217-Apr-07 20:19 

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.