Click here to Skip to main content
16,004,969 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: want to fransfer datas from sql server to excel Pin
kumareshTMC3-Jan-08 22:27
kumareshTMC3-Jan-08 22:27 
GeneralRe: want to fransfer datas from sql server to excel Pin
Deepthy.P.M4-Jan-08 1:42
Deepthy.P.M4-Jan-08 1:42 
GeneralDatabase Exception Pin
SreejithAchutan3-Jan-08 20:02
SreejithAchutan3-Jan-08 20:02 
GeneralRe: Database Exception Pin
Michael Sync3-Jan-08 20:08
Michael Sync3-Jan-08 20:08 
GeneralRe: Database Exception Pin
SreejithAchutan3-Jan-08 20:10
SreejithAchutan3-Jan-08 20:10 
GeneralRe: Database Exception Pin
Michael Sync3-Jan-08 20:50
Michael Sync3-Jan-08 20:50 
GeneralRe: Database Exception Pin
SreejithAchutan3-Jan-08 21:39
SreejithAchutan3-Jan-08 21:39 
GeneralRe: Database Exception Pin
Michael Sync3-Jan-08 21:54
Michael Sync3-Jan-08 21:54 
SreejithAchutan wrote:
public void UpdateUnitDetails(int UnitId, string UnitName, string UnitShortName, string Location, string UnitLogoPath, string UnitStream, string MaxStudentsPerClass, string LastModifiedByUser)
{
string sqlstatement;
Boolean isUpdated;
try
{
sqlstatement = "UPDATE Units SET UnitName='" + UnitName + "',UnitShortName='" + UnitShortName + "',Location='" + Location + "',UnitLogoPath='" + UnitLogoPath + "',UnitStream='" + UnitStream + "',MaxStudentsPerClass='" + MaxStudentsPerClass + "',LastModifiedByUser='" + LastModifiedByUser + "' WHERE UnitId='" + UnitId + "'";
isUpdated = dbtObj.ExecuteSqlCmd(sqlstatement);
}
finally
{
}
}


What is the code for updating the image? Are you updating the path of image (string) or image (bytes)?

The code below is for updating the image column ... (Note: I typed just like that so you may need to fix some syntax errors but you can get the idea from that code. )
<br />
byte[] img = /// Your image wil come here..<br />
<br />
SqlCommand update = new SqlCommand("UPDATE Person SET ImageColumn = @image<br />
WHERE personalID = " + pID, con);<br />
<br />
SqlParameter imageParameter = update.Parameters.Add("@image",<br />
SqlType.Image);<br />
imageParameter.Value = img;<br />
imageParameter.Size = img.Length;


Hope it helps..

Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)


GeneralRe: Database Exception Pin
Paul Conrad4-Jan-08 6:52
professionalPaul Conrad4-Jan-08 6:52 
GeneralRe: Database Exception Pin
SreejithAchutan3-Jan-08 21:49
SreejithAchutan3-Jan-08 21:49 
GeneralRe: Database Exception Pin
SreejithAchutan3-Jan-08 22:28
SreejithAchutan3-Jan-08 22:28 
Questionupdate button in grid view Pin
Sonia Gupta3-Jan-08 19:53
Sonia Gupta3-Jan-08 19:53 
GeneralRe: update button in grid view Pin
Michael Sync3-Jan-08 19:57
Michael Sync3-Jan-08 19:57 
GeneralRe: update button in grid view Pin
Sonia Gupta3-Jan-08 20:10
Sonia Gupta3-Jan-08 20:10 
GeneralRe: update button in grid view [modified] Pin
Michael Sync3-Jan-08 20:20
Michael Sync3-Jan-08 20:20 
GeneralRe: update button in grid view Pin
Sonia Gupta3-Jan-08 20:24
Sonia Gupta3-Jan-08 20:24 
GeneralRe: update button in grid view Pin
Michael Sync3-Jan-08 20:48
Michael Sync3-Jan-08 20:48 
GeneralRe: update button in grid view Pin
Sonia Gupta3-Jan-08 20:55
Sonia Gupta3-Jan-08 20:55 
GeneralRe: update button in grid view Pin
Michael Sync3-Jan-08 21:03
Michael Sync3-Jan-08 21:03 
General- Pin
Michael Sync3-Jan-08 20:05
Michael Sync3-Jan-08 20:05 
GeneralRe: update button in grid view Pin
janet20083-Jan-08 21:15
janet20083-Jan-08 21:15 
GeneralRe: update button in grid view Pin
N a v a n e e t h3-Jan-08 22:10
N a v a n e e t h3-Jan-08 22:10 
GeneralRe: update button in grid view Pin
Sonia Gupta3-Jan-08 22:30
Sonia Gupta3-Jan-08 22:30 
GeneralColumns Width Pin
~V~3-Jan-08 19:44
~V~3-Jan-08 19:44 
GeneralRe: Columns Width Pin
Michael Sync3-Jan-08 19:54
Michael Sync3-Jan-08 19: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.