Click here to Skip to main content
15,888,579 members
Home / Discussions / C#
   

C#

 
GeneralRe: ActiveX Control & Interop Pin
AJ12320-Apr-07 4:13
AJ12320-Apr-07 4:13 
GeneralRe: ActiveX Control & Interop Pin
Judah Gabriel Himango20-Apr-07 5:05
sponsorJudah Gabriel Himango20-Apr-07 5:05 
GeneralRe: ActiveX Control & Interop Pin
AJ12320-Apr-07 5:09
AJ12320-Apr-07 5:09 
GeneralRe: ActiveX Control & Interop Pin
Judah Gabriel Himango20-Apr-07 5:27
sponsorJudah Gabriel Himango20-Apr-07 5:27 
QuestionSubsequent mouse clicks Pin
pranu_1320-Apr-07 3:37
pranu_1320-Apr-07 3:37 
AnswerRe: Subsequent mouse clicks Pin
kubben20-Apr-07 3:51
kubben20-Apr-07 3:51 
AnswerRe: Subsequent mouse clicks Pin
Tarakeshwar Reddy20-Apr-07 3:55
professionalTarakeshwar Reddy20-Apr-07 3:55 
QuestionUpdate database. Pin
Scalee20-Apr-07 3:36
Scalee20-Apr-07 3:36 
Im trying to update the content in the database but it doesnt work i dont understand why.
I commented most of the code tell me if something is unclear

Get content code:

//if creating new file use textbox1 rather then the double clicked data cell
string fns = "";
if (open == false)
{
dataGridView1.CurrentCell = this.dataGridView1[0, e.RowIndex];
fns = dataGridView1.CurrentCell.Value.ToString();
}
else
{
//use filename box (file creation)
fns = textBox1.Text;
}


// get content where name == fns
SqlConnection sql = new SqlConnection(sqlcon);
a = new SqlDataAdapter("SELECT [Content], [primkey], [Name] FROM Keeper WHERE [Name] ='" + fns + "'", sqlcon);

try
{

a.Fill(s, "Keeper");
foreach (DataRow dr in s.Tables[0].Rows)
{
dataGridView2.DataSource = s;
dataGridView2.DataMember = "Keeper";
}
//get content from datagrid insert into richtextbox
dataGridView2.CurrentCell = this.dataGridView2[0, 0];
richTextBox1.Text = dataGridView2.CurrentCell.Value.ToString();
}

catch (SqlException sqlexcp)
{
MessageBox.Show(sqlexcp.Message.ToString());
}

//close connection, reset bool, bring up editor
sql.Close();
open = false;
richTextBox1.BringToFront();

Save content:

//get content from textbox insert into datagrid
dataGridView2.CurrentCell = this.dataGridView2[0, 0];
dataGridView2.CurrentCell.Value = richTextBox1.Text;
//update DB
SqlCommandBuilder mySqlCommandBuilder = new SqlCommandBuilder(a);
a.Update(s, "Keeper");
AnswerRe: Update database. Pin
darkcalin20-Apr-07 4:33
darkcalin20-Apr-07 4:33 
GeneralRe: Update database. Pin
Scalee20-Apr-07 9:46
Scalee20-Apr-07 9:46 
QuestionSuggestion required Pin
Syed Muhammad Kamran20-Apr-07 3:29
Syed Muhammad Kamran20-Apr-07 3:29 
AnswerRe: Suggestion required Pin
Tarakeshwar Reddy20-Apr-07 3:59
professionalTarakeshwar Reddy20-Apr-07 3:59 
AnswerRe: Suggestion required Pin
Aaron VanWieren20-Apr-07 9:18
Aaron VanWieren20-Apr-07 9:18 
AnswerRe: Suggestion required Pin
Vega0220-Apr-07 21:22
Vega0220-Apr-07 21:22 
AnswerRe: Suggestion required Pin
Syed Muhammad Kamran20-Apr-07 23:45
Syed Muhammad Kamran20-Apr-07 23:45 
GeneralRe: Suggestion required Pin
Keshav V. Kamat22-Apr-07 23:19
Keshav V. Kamat22-Apr-07 23:19 
QuestionAbout Diffgram Pin
John.L.Ponratnam20-Apr-07 3:24
John.L.Ponratnam20-Apr-07 3:24 
AnswerRe: About Diffgram Pin
Sathesh Sakthivel20-Apr-07 3:44
Sathesh Sakthivel20-Apr-07 3:44 
AnswerRe: About Diffgram Pin
Keshav V. Kamat22-Apr-07 23:21
Keshav V. Kamat22-Apr-07 23:21 
QuestionHow to convert .gif to .doc formate in c# with asp.net Pin
attalurisubbu20-Apr-07 3:11
attalurisubbu20-Apr-07 3:11 
AnswerRe: How to convert .gif to .doc formate in c# with asp.net Pin
Judah Gabriel Himango20-Apr-07 5:28
sponsorJudah Gabriel Himango20-Apr-07 5:28 
QuestionReagrding Datagridview Control in C# Pin
Mr Perfect20-Apr-07 2:09
Mr Perfect20-Apr-07 2:09 
AnswerRe: Reagrding Datagridview Control in C# Pin
Sathesh Sakthivel20-Apr-07 2:48
Sathesh Sakthivel20-Apr-07 2:48 
QuestionQuery Regarding Events Pin
John.L.Ponratnam20-Apr-07 1:56
John.L.Ponratnam20-Apr-07 1:56 
AnswerRe: Query Regarding Events Pin
Christian Graus20-Apr-07 2:11
protectorChristian Graus20-Apr-07 2:11 

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.