Click here to Skip to main content
15,900,359 members
Home / Discussions / C#
   

C#

 
QuestionReflection for COM objects Pin
El'Cachubrey20-Apr-07 5:27
El'Cachubrey20-Apr-07 5:27 
QuestionIs there a way to capture a bitmap signature? Pin
daddion20-Apr-07 5:05
daddion20-Apr-07 5:05 
AnswerRe: Is there a way to capture a bitmap signature? Pin
Dave Kreskowiak20-Apr-07 6:24
mveDave Kreskowiak20-Apr-07 6:24 
AnswerRe: Is there a way to capture a bitmap signature? Pin
Judah Gabriel Himango20-Apr-07 10:17
sponsorJudah Gabriel Himango20-Apr-07 10:17 
GeneralRe: Is there a way to capture a bitmap signature? Pin
Dave Kreskowiak20-Apr-07 10:38
mveDave Kreskowiak20-Apr-07 10:38 
Questionstring vs String functions Pin
senylity20-Apr-07 4:50
senylity20-Apr-07 4:50 
AnswerRe: string vs String functions Pin
Daniel Grunwald20-Apr-07 4:55
Daniel Grunwald20-Apr-07 4:55 
GeneralRe: string vs String functions Pin
Aaron VanWieren20-Apr-07 9:16
Aaron VanWieren20-Apr-07 9:16 
GeneralRe: string vs String functions Pin
Luc Pattyn20-Apr-07 12:09
sitebuilderLuc Pattyn20-Apr-07 12:09 
AnswerRe: string vs String functions Pin
Scott Dorman20-Apr-07 16:19
professionalScott Dorman20-Apr-07 16:19 
AnswerRe: string vs String functions Pin
Keshav V. Kamat22-Apr-07 23:12
Keshav V. Kamat22-Apr-07 23:12 
QuestionCan't Drag and Drop Pin
jchigg200020-Apr-07 3:56
jchigg200020-Apr-07 3:56 
AnswerRe: Can't Drag and Drop Pin
kubben20-Apr-07 4:49
kubben20-Apr-07 4:49 
QuestionWebBrowser Pin
GedMurphy20-Apr-07 3:51
GedMurphy20-Apr-07 3:51 
QuestionActiveX Control & Interop Pin
AJ12320-Apr-07 3:41
AJ12320-Apr-07 3:41 
AnswerRe: ActiveX Control & Interop Pin
Judah Gabriel Himango20-Apr-07 4:07
sponsorJudah Gabriel Himango20-Apr-07 4:07 
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 

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.