Hi, I try to put a timer on my webpage, and my purpose is to trigger an update of certain content of this page. So I "new" a asp.net web application in Visual Studio.net2003 and "drag and drop" a "timer" component from toolbox to the webform. set "interval" to "2000" and "enable" it. But it doesn't works. If I debug it, looks like the timer doesn't run in the normal style. Does anybody encounter this problem before? Is there a better way to make a webpage update periodically by itself? Thanks. Regards Kevin
kd8341
Posts
-
timer on webpage -
longblob column in MySQL database tableI am using DataSet to insert a data row which contains a 6MByte binary file in "Data" column. According to the MySQL manual for 4.0, I define the "Data" column as "longblob", which suppose to store up to 4GByte file. But it just doesn't work. With the exact same code, if my data is less than 100KByte, it works fine. Can anybody tell if I have to config anywhere else to make this work? From MySQL 4.0, the maximum allowed length of LONGBLOB columns depends on the configured maximum packet size in the client/server protocol and available memory. I just wonder what "client/server protocol" refers to? How can I figure out the maximum packet size?
-
"ref" equivalent keyword in C++I am using VC++.net 2003 to access matlab with C API, I have to call a function which is programmed in C#. It looks like VC++.net doesn't like "ref" keyword. >>>>>>>>>>> r = ma.GetMatrix(matname, ref a); /// <--- source code from C# <<<<<<<<<<< "ref" works well in C#, but when I call this function ("GetMatrix") in managed C++, I got an compilation error: >>>>>>>>>>> "cannot covert parameter 2 from 'double __gc[,]' to 'double (__gc *) __gc[,]' <<<<<<<<<<< I am new to VSS.net, could anybody kindly help me if there is "ref" equivalent keyword in C++? Many thanks!
-
save BMP to JPGSorry, I didn't express myself clearly, but I need to convert BMP to JPG in run time(within program). Is there any sample code in Visual studio? Thanks a lot!
-
save BMP to JPGI am using visual studio .net and want to save a BMP file to JPG format. How to do this? Is there a sample code for reference? Thanks.
-
Update an item in MySQL with VS2003I try to use ODBC to update an item in MySQL table "my_status", but it doesn't work. Seems the data can be loaded to the dataset, but how to write it back to the data sourse? Is there anybody can give me some ideas or samples on how to do this? Here is my code: /////connect to the database with DataSet String* strSql = "SELECT * FROM my_status"; OdbcDataAdapter* da = new OdbcDataAdapter(strSql,MYSQLCONN); OdbcCommandBuilder* custCB = new OdbcCommandBuilder(da); OdbcCommand* cmd; cmd = new OdbcCommand("Select * from my_status", MyConn); da->SelectCommand = cmd; DataSet* wrbtDS = new DataSet(); da->Fill(wrbtDS, "my_status"); DataRow* cRow = wrbtDS->Tables->Item["my_status"]->Rows->Item[0]; //// load the image into the dataset String * FILE_NAME = "Solid.jpg"; // for inserting a image file FileStream* fs = new FileStream(FILE_NAME, FileMode::Open, FileAccess::Read); Int16 imglen = (int)fs->Length; Byte buffer[] = new Byte[imglen]; fs->Read(buffer,0,buffer->Length); cRow->Item["image"] = buffer; /* until here the item["image"] is changed and shows in DataSet, but how to update the data source with this updated DataSet??????? The following code doesn't work and how to figure it out?*/ wrbtDS->Tables->Item["my_status"]->Rows->Item[0]->AcceptChanges(); da->Update(wrbtDS, "my_status"); Thanks a lot! Kevin
-
update image column in MySQLI can update regular column with varchar/numeric type, but I when I try to update image data(longblob) in MySQL, but it doesn't work. Can anybody help me on how to do that? Here is my code for this: ProducerConn->Open(); ProducerSide->CommandText = "DROP TABLE IF EXISTS MyDB"; ProducerSide->ExecuteNonQuery(); ProducerSide->CommandText = "CREATE TABLE MyDB (ID timestamp(14), ext varchar(5), image longblob)"; ProducerSide->ExecuteNonQuery(); String * FILE = "image.jpg"; FileStream * tfs = new FileStream(FILE, FileMode::Open, FileAccess::Read); Int16 len = (int)tfs->Length; Byte buffer[] = new Byte[len]; tfs->Read(buffer, 0, buffer->Length); // ProducerSide->CommandText = "update MyDB set image=buffer"; <---- line with problem ProducerSide->CommandText = "UPDATE MyDB set ext='jpg'"; ProducerSide->ExecuteNonQuery(); Thanks!
-
insert /retrieve text file into/from MySQLHi, Davey: Thanks for your response. Here are my code for text file: String * NCFILE_NAME = "test10.nc"; FileStream * tfs = new FileStream(NCFILE_NAME, FileMode::Open, FileAccess::Read); Char ncbuffer[] = new Char[(int)tfs->Length]; tfs->Read(ncbuffer, 0, ncbuffer->Length); My intention is to read the text from "test10.nc" and write to Char Array ncbuffer[], but tfs->Read(ncbuffer, 0, ncbuffer->Length); cause the error like this: cannot convert parameter 1 from '__wchar_t __gc[]' to 'unsigned char __gc[]' When I did exactly the same for binary file, and define as: FileStream* fs = new FileStream(FILE_NAME, FileMode::Open, FileAccess::Read); Byte buffer[] = new Byte[(int)fs->Length]; fs->Read(buffer,0,buffer->Length); String* extension = "jpg"; // for image file It works fine. So I guess maybe I should use something other than FileStream. But what is it? Could you please give me some ideas about this? Regards, Kevin
-
insert /retrieve text file into/from MySQLHi, Davey: Thanks for your response. Here are my code for text file: String * NCFILE_NAME = "test10.nc"; FileStream * tfs = new FileStream(NCFILE_NAME, FileMode::Open, FileAccess::Read); Char ncbuffer[] = new Char[(int)tfs->Length]; tfs->Read(ncbuffer, 0, ncbuffer->Length); My intention is to read the text from "test10.nc" and write to Char Array ncbuffer[], but tfs->Read(ncbuffer, 0, ncbuffer->Length); cause the error like this: cannot convert parameter 1 from '__wchar_t __gc[]' to 'unsigned char __gc[]' When I did exactly the same for binary file, and define as: FileStream* fs = new FileStream(FILE_NAME, FileMode::Open, FileAccess::Read); Byte buffer[] = new Byte[(int)fs->Length]; fs->Read(buffer,0,buffer->Length); String* extension = "jpg"; // for image file It works fine. So I guess maybe I should use something other than FileStream. But what is it? Could you please give me some ideas about this?
-
insert /retrieve text file into/from MySQLI have a sample code of insert/retrieve binary file into/from MySQL, it uses FileStream to implement the function. Seems FileStream doesn't work for text file. Can anybody tell what function should I use to retrieve text file from MySQL? Or if you could suggest a sampel code, that will be very helpful. Thanks!
-
insert record into mysql tableI am a new comer in MySQL area, and I want to build an database application with Visual Studio .net 2003. My questions are: 1. How can I insert records into MySQL table in .net2003? 2. Can MySQL support image data in the record (like JPG/BMP file)? I searched these topics in CP but didn't find answer. Can anybody suggests some articles or sample code about this? Thanks a lot! Kevin
-
use ActiveX in C# web applicationI have a C# web application which need to use an ActiveX in it. I can find some article on ActiveX using C++, I am unable to find a sample of C# call ActiveX. I am not sure if ActiveX only comes with C++? My IDE is Visula studio.net2003. If you have some ideas about this, or some sample code/article, please let me know. Thanks a lot. Kevin
-
use ActiveX control in C# web applicationI have a C# web application which need to use an ActiveX in it. I can find some article on ActiveX using C++, I am unable to find a sample of C# call ActiveX. I am not sure if ActiveX only comes with C++? If you have some ideas about this, or some sample code/article, please let me know. Thanks a lot. Kevin