Click here to Skip to main content
15,889,736 members
Home / Discussions / C#
   

C#

 
GeneralRe: Friend Assembly Help needed... Pin
oykica6-Jun-05 6:57
oykica6-Jun-05 6:57 
GeneralRe: Friend Assembly Help needed... Pin
pavel.drtil26-May-10 1:18
pavel.drtil26-May-10 1:18 
GeneralMy own little lexer/parser (trouble even getting started) Pin
Insolence5-Jun-05 18:50
Insolence5-Jun-05 18:50 
QuestionHow to save Images in Mysql DataBase Through C# Pin
monica2k5-Jun-05 18:37
monica2k5-Jun-05 18:37 
AnswerRe: How to save Images in Mysql DataBase Through C# Pin
Christian Graus5-Jun-05 18:39
protectorChristian Graus5-Jun-05 18:39 
GeneralRe: How to save Images in Mysql DataBase Through C# Pin
monica2k5-Jun-05 19:07
monica2k5-Jun-05 19:07 
AnswerRe: How to save Images in Mysql DataBase Through C# Pin
pubududilena5-Jun-05 22:35
pubududilena5-Jun-05 22:35 
GeneralRe: How to save Images in Mysql DataBase Through C# Pin
monica2k6-Jun-05 13:57
monica2k6-Jun-05 13:57 
hi I did the same thing which u suggested in that link but i am getting this exception

An unhandled exception of type 'System.Data.DBConcurrencyException' occurred in system.data.dll

Additional information: Concurrency violation: the UpdateCommand affected 0 records.

my code is like this
The table is tblPatientMaster with feilds one PatPhoto thats is long Blob and one patientId that is a bigint.

public static void UpdatePatientPhoto( long PatID,ref byte[] content )
{
DataRow PatRow;
String ConnectionString =
System.Configuration.ConfigurationSettings.AppSettings["DSN"];
String query= "Select* from tblpatientmaster where patientId = " +
PatID ;
OdbcConnection myConnection = new OdbcConnection(ConnectionString);
myConnection.Open();
OdbcDataAdapter myAdapter=new OdbcDataAdapter(query,myConnection);
DataSet ds= new DataSet("tblpatientmaster");
myAdapter.UpdateCommand = new OdbcCommand
("UPDATE tblpatientmaster SET " +
"PatPhoto = @iPHOTO " +
"WHERE patientId = @iPatNo", myConnection);

myAdapter.UpdateCommand.Parameters.Add("@iPHOTO", OdbcType.Binary,
content.Length, "patphoto");
myAdapter.UpdateCommand.Parameters.Add("@iPatNo", OdbcType.BigInt,
0, "patientId");

myAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
myAdapter.FillSchema(ds, SchemaType.Source, "tblpatientmaster");
myAdapter.Fill(ds,"tblpatientmaster");
DataTable PatTable = ds.Tables["tblpatientmaster"];
PatRow = PatTable.Rows.Find(PatID);
PatRow.BeginEdit();
if (content.Length != 0)
{
PatRow["PatPhoto"] = content;
}
PatRow.EndEdit();
myAdapter.Update(ds,"tblpatientmaster");
}


Pls anybody can help me with this problem.
Thanks
Monica
QuestionCustom Repeater or something else? Pin
methodincharge5-Jun-05 16:52
methodincharge5-Jun-05 16:52 
AnswerRe: Custom Repeater or something else? Pin
Christian Graus5-Jun-05 16:54
protectorChristian Graus5-Jun-05 16:54 
GeneralRe: Custom Repeater or something else? Pin
methodincharge5-Jun-05 17:12
methodincharge5-Jun-05 17:12 
GeneralRe: Custom Repeater or something else? Pin
Christian Graus5-Jun-05 17:17
protectorChristian Graus5-Jun-05 17:17 
GeneralDisplay Application Names from Active Directory Group Policy Management Console using vb.net or C#.net Pin
Member 16715325-Jun-05 16:04
Member 16715325-Jun-05 16:04 
GeneralExecuting Another Application From a C# Program Pin
vylkier5-Jun-05 15:47
vylkier5-Jun-05 15:47 
GeneralRe: Executing Another Application From a C# Program Pin
Christian Graus5-Jun-05 15:52
protectorChristian Graus5-Jun-05 15:52 
QuestionFirewall??? Pin
Duong Tien Nam5-Jun-05 15:31
Duong Tien Nam5-Jun-05 15:31 
AnswerRe: Firewall??? Pin
rocky_pulley6-Jun-05 2:25
rocky_pulley6-Jun-05 2:25 
GeneralUsing an image as a resource programmatically... Pin
new_phoenix5-Jun-05 14:53
new_phoenix5-Jun-05 14:53 
GeneralRe: Using an image as a resource programmatically... Pin
Christian Graus5-Jun-05 15:18
protectorChristian Graus5-Jun-05 15:18 
GeneralRe: Using an image as a resource programmatically... Pin
new_phoenix7-Jun-05 9:24
new_phoenix7-Jun-05 9:24 
GeneralWinForms keeps closing my dialogs !!! Pin
Christian Graus5-Jun-05 12:09
protectorChristian Graus5-Jun-05 12:09 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
DavidNohejl5-Jun-05 12:44
DavidNohejl5-Jun-05 12:44 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
Christian Graus5-Jun-05 12:51
protectorChristian Graus5-Jun-05 12:51 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
DavidNohejl5-Jun-05 13:46
DavidNohejl5-Jun-05 13:46 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
Judah Gabriel Himango5-Jun-05 13:43
sponsorJudah Gabriel Himango5-Jun-05 13:43 

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.