|
I researched about this topic a little and written a program which is I think enough for you to understand how CodeProvider works.
Just run the project and enter
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("IS IT WORKING!!");
Console.ReadLine();
}
}
}
to the textbox. Then press Generate. The compiled executable will be in the same direcory as your program is, as "product.exe"
http://rapidshare.com/files/227199842/RealTime_Csharp_Code_Compiler.rar[^]
Let me know what you think.
|
|
|
|
|
It works for me!
|
|
|
|
|
|
There is an ApplicationSettingsBase.Save method. Don't know if it will help you but it has to be worth a look.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi, I encountered a problem with refreshing my Datagridview from a MySQL database.
Basically, my Datagridview is placed in a TabPage. This TabPage is toggled visually by a MenuStripItem. When the menu item is clicked, it will either open or close the TabPage. When it opens the TabPage, I have set an event handler to refresh the Datagridview with new data from the MySQL database.
These are the 2 event handlers for the MenuStripItem.
private delegate void Update_Delegate(DataTable input);
private void db_list_update(DataTable input){
db_list.EndEdit();
db_list.Refresh();
db_list.DataSource = input;
}
private void db_toggle(object sender, EventArgs e){
if (db_shown){
tab_control.TabPages.Remove(db_tab);
num_tabs_shown--;
check_tab_visibility();
db_shown = false;
db_list.Invoke(new Update_Delegate(this.db_list_update), new object[] {db_test.mysql_query(db_query)});
}
else if (!db_shown){
tab_control.Visible = true;
tab_control.TabPages.Insert(0,db_tab);
tab_control.SelectedTab = db_tab;
num_tabs_shown++;
check_tab_visibility();
Show_DB_List();
db_list.Invoke(new Update_Delegate(this.db_list_update), new object[] {db_test.mysql_query(db_query)});
db_shown = true;
}
db_test = null;
}
The problem is that the data in the DataGridView refuses to be refreshed after the second click. That is, when I open the DataGridView, it loads from the database. Then I close it and it refreshes itself. When I open it again, it does not refresh thereafter.
Also, I have put in a HitTest to track the DataSource values of the DataGridView. The DataSource values are being updated but the DataGridView does not reflect the updated values from the DataSource despite my attempts to refresh it and reload the DataSource.
Any help will be much appreciated
|
|
|
|
|
Hello.
Im having a php post site on my server where i can upload files.
The problem is just that it doest upload the file at all.
Im trying through the php script to upload a file to the database. It works fine when i do it manually from the site, but not when im using UploadFile().
My C# code looks like:
string file = "1.jpg";
string url = "http://myserver.net/ind.php?userid="+_userid+"";
try
{
WebClient InsertClient = new WebClient();
byte[] Response = InsertClient.UploadFile(url, "POST", file);
label1.Text = Response.Length.ToString();
}
catch (Exception ex)
{
label1.Text = ex.ToString();
}
And the uploadsite looks like and is called "ind.php":
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
$fp = fopen($tmpName, 'r');
$content = fread($fp, filesize($tmpName));
$content = addslashes($content);
fclose($fp);
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
}
include "dbcon.php";
$query = "INSERT INTO files (userid, imageData ) ".
"VALUES ('".$_GET['userid']."', '$content')";
mysql_query($query) or die('Error, query failed');
echo " File $fileName uploaded ";
It only adds the userid to the database but without any content of the file.
Have anyone got this problem before?
|
|
|
|
|
And yes, the upload form is a POST method
|
|
|
|
|
And the output from the upload site is that "File name cannot be empty"..
|
|
|
|
|
Your problem is with your PHP code which is looking at the wrong variables. The upload method places the info into $_FILES['file'], not $_FILES['userfile'].
Better late than never I suppose.
|
|
|
|
|
Bitmap bmpScreenshot;
Graphics gfxScreenshot;
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
gfxScreenshot.CopyFromScreen(0, 0, 0, 0, bmpScreenshot.Size);
bmpScreenshot.Save(@"\screenshot.bmp", ImageFormat.Bmp);
It works fine in windows.But it is showing no extension method like CopyFromScreen in windowsmobile.
Would u pls help me out to take screenshot in windowsmobile in C#?
|
|
|
|
|
A Screen Capture Tool for Windows Mobile 5[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
There is a Mobile Development forum. You might have done better posting this question there.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
OleDbConnection clsConnection;
clsConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\.one.mdb;");
clsConnection.Open();
WTest1.oneDataSet f_table = new WTest1.oneDataSet();
OleDbDataAdapter dAdapter = new OleDbDataAdapter("select * from first", clsConnection);
dAdapter.Fill(f_table, "first");
clsConnection.Close(); I've used this code in a previous application and it worked fine, however in this application, it's giving me this error about FROM syntax.
Can someone please tell me what's wrong??
Star
|
|
|
|
|
are you sure there is table called 'first' and also do you have 2 spaces between 'from' and 'first'. Im sure queries don't like double spaces
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Star09 wrote: Data Source=C:\\.one.mdb
do you need the first period?
|
|
|
|
|
I have removed the path because it was so long, but I do have it in my application, lol.
As for the double spaces, didn't notice them, thanks, but still even though I removed the double spaces, still same runtime error
|
|
|
|
|
Star09 wrote: As for the double spaces, didn't notice them, thanks, but still even though I removed the double spaces, still same runtime error
you should reply that message to me....
What is the error message you are getting?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
the message doesn't make sense, Syntax error in FROM clause.
|
|
|
|
|
Okay when I commented my other connections, it worked.
|
|
|
|
|
Hi,
In my application, i used a theme.
and when i carry one form over another form, this process is too slow.
how can i solve this problem?
|
|
|
|
|
|
yes it is...because windows do not use Graphic card acceleration. Either develope full screen app or do not use heavy images those hurts the performance.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Exploring some MS assembly using reflector I found something odd: a class declared internal in one assembly that was being used in a different one.
That does not make sense to me. As far as you know, there is some (legal) way to achieve that, or Microsoft is using some C# and/or IL "magic" to make that possible?
|
|
|
|
|
|
Wow, I'd never tought that something like that existed!
Tank you
|
|
|
|