Click here to Skip to main content
15,918,808 members
Home / Discussions / C#
   

C#

 
GeneralStupid WinForms Pin
Christian Graus5-Jun-05 21:32
protectorChristian Graus5-Jun-05 21:32 
GeneralRe: Stupid WinForms Pin
Ashok Dhamija5-Jun-05 22:13
Ashok Dhamija5-Jun-05 22:13 
GeneralRe: Stupid WinForms Pin
Christian Graus6-Jun-05 12:20
protectorChristian Graus6-Jun-05 12:20 
GeneralRe: Stupid WinForms Pin
Ashok Dhamija6-Jun-05 18:54
Ashok Dhamija6-Jun-05 18:54 
GeneralRe: Stupid WinForms Pin
Christian Graus6-Jun-05 18:58
protectorChristian Graus6-Jun-05 18:58 
GeneralRe: Stupid WinForms Pin
Maqsood Ahmed5-Jun-05 22:16
Maqsood Ahmed5-Jun-05 22:16 
GeneralRe: Stupid WinForms Pin
Christian Graus6-Jun-05 12:20
protectorChristian Graus6-Jun-05 12:20 
GeneralRe: Stupid WinForms Pin
S. Senthil Kumar6-Jun-05 0:42
S. Senthil Kumar6-Jun-05 0:42 
GeneralRe: Stupid WinForms Pin
Christian Graus6-Jun-05 12:21
protectorChristian Graus6-Jun-05 12:21 
Generalsql stored preocedure Pin
Mohammad Daba'an5-Jun-05 20:08
Mohammad Daba'an5-Jun-05 20:08 
GeneralRe: sql stored preocedure Pin
Colin Angus Mackay5-Jun-05 20:51
Colin Angus Mackay5-Jun-05 20:51 
GeneralRe: sql stored preocedure Pin
Mohammad Daba'an5-Jun-05 22:51
Mohammad Daba'an5-Jun-05 22:51 
GeneralRe: sql stored preocedure Pin
Colin Angus Mackay6-Jun-05 0:28
Colin Angus Mackay6-Jun-05 0:28 
GeneralRe: sql stored preocedure Pin
Mohammad Daba'an6-Jun-05 0:44
Mohammad Daba'an6-Jun-05 0:44 
GeneralFriend Assembly Help needed... Pin
chettu5-Jun-05 19:15
chettu5-Jun-05 19:15 
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 

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.