|
SK84 wrote: I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#.
That is the stupidest thing I have ever heard.
SK84 wrote: I am asked
Anyone who asks someone to do production level tasks after 4 weeks of learning a language, gets what they deserve.
SK84 wrote: and use the serialize/deserialize methods to get the work done
I guess you want to write code in those methods that turn the classes in to XML or read them from XML then.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: That is the stupidest thing I have ever heard.
Surely not - if stupid is as stupid does, these people does stoopid.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Christian Graus wrote: Anyone who asks someone to do production level tasks after 4 weeks of learning a language, gets what they deserve.
I was fixing bugs in C# barely 2 weeks after being hired (never having touched the language before), and thanks to a bureaucratic snafu didn't have a PC for the first 3ish days.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Can you use CommandBehavior.SequentialAccess with data in a VARBINARY column?
I have a downloads pulling from that column but not doing it that way.... here is my code:
int bytesSize = 0;
byte[] downBuffer = new byte[1024];
byte[] buffer = (byte[])cmd.ExecuteScalar();
conn.Close();
MemoryStream ms = new MemoryStream(buffer);
FileStream fs = new FileStream(Path, FileMode.Create, FileAccess.ReadWrite);
while ((bytesSize = ms.Read(downBuffer, 0, downBuffer.Length)) > 0)
{
fs.Write(downBuffer, 0, bytesSize);
WriteTextBox((fs.Length / 1024) + "KB of " + (ms.Length / 1024) + "KB.");
bw.ReportProgress(Convert.ToInt32((fs.Length * 100) / ms.Length));
}
fs.Close();
ms.Close();
The problem is it gets all the data here:
byte[] buffer = (byte[])cmd.ExecuteScalar();
So if I'm correct it is getting ALL of the data there. Which if it is a large file.. not even that large, it pauses there until it gets it.. Now on remote connections it times out because it doesn't have that long. But also the way I have it reports progress when writing to the file, but I want to report progress on downloading the file.
I have seen code used with this for BLOB data, but the column is not the type TEXT.
|
|
|
|
|
Jacob Dixon wrote: but I want to report progress on downloading the file.
You mean you want to show progress when ExecuteScalar is working? AFAIK, that is not possible. There is no way to know how the long the SQL is going to take. There is asynchronous methods like, BeginExecuteReader available. This method will not block the current thread. So you can display some message to user saying the progress.
|
|
|
|
|
I need to create simple query designer. because we need to give sql query designing part to our customers. The main headache to me is visualize the joining. I use custom controller (checkedListbox and button) to visualize the table. Please help me to do this.
Dushan Perera
|
|
|
|
|
I wrote a query designer way back. You can find the implementation at www.analysis6.com[^] it is not open source. Start looking for sources matching what you need and check out other implementations. Good Luck
Natza Mitzi
|
|
|
|
|
I'm building a custom control inherited from a picturebox control, and I would like it to automatically resize to the dimensions of the container control to which it is added(could be any valid container control)
Referencing the Parent of the custom control in its structure definition
Public MycustomePicBox()
{
this.Size=new System.Drawing.Size(this.Parent.Clientrectangle....
}
isn't possible because at the time the code executes, the custom control hasn't been added to the container control yet.
Is there an event that fires for a Control when it has been added to a container?
modified on Sunday, March 29, 2009 10:43 PM
|
|
|
|
|
I hope I haven’t got the wrong end of the stick of what you’re trying to achieve.
I’ve just had a quick look, and found that there’s an event available for when controls are added to a user control. Try using the ControlAdded Event.
To initialize it do the following…
<code>
public userControl1()
{
InitializeComponent();
/*
Please note, the code below should really be inside InitializeComponent();
But for speed, i've added it in here.
Add the line below…
Note: Press Tab key after typing in += as this will auto complete the rest of the event.
*/
this.ControlAdded+=new ControlEventHandler(userControl1_ControlAdded);
}
private void userControl1_ControlAdded(object sender, ControlEventArgs e)
{
// execute your methods for resizing to parent control.
}
</code>
I hope this has helped?
P.S. I am using the latest version of C#.Net framework 3.5 so I’m guessing that these events are also available for frameworks 1.1 and 2.
Rule 1 - Don’t break what’s not broken!
Rule 2 - Don’t reinvent the wheel… just give it a lick of paint!
Rule 3 - Keep plenty of programmer foods to hand… Pizza, beer & crisps... including the books on "How to Crash Your System in Twenty Seconds!"
|
|
|
|
|
I think that event fires for the container control.
|
|
|
|
|
Hello everybody.
How can I get this path with C# ?
%SystemRoot%\Microsoft.NET\Framework\
Thank you.
|
|
|
|
|
|
I prefer <a href="http://msdn.microsoft.com/en-us/library/system.environment.expandenvironmentvariables.aspx">Environment.ExpandEnvironmentVariables</a>[<a href="http://msdn.microsoft.com/en-us/library/system.environment.expandenvironmentvariables.aspx" target="_blank" title="New Window">^</a>]
|
|
|
|
|
Nice. I wasn't aware of it.
|
|
|
|
|
Hi,
If your question was not specifically about environment variables but instead about the directory containing the common language runtime then take a look at the System.Runtime.InteropServices.RuntimeEnvironment class.
The GetRunTimeDirectory method may be what you want.
Alan.
modified on Sunday, March 29, 2009 8:16 PM
|
|
|
|
|
Hi,
I'm new with C# and I have a little problem.
I'm trying to make button and when the user clicks the button,
textbox shows message "This works!"
However, nothing happens when the button is pressed down.
Could you please help me?
The code is listed below.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication2
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button NaytaTeksti;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
private void NaytaTeksti_Click(object sender, EventArgs e)
{
string text = "This works!";
textBox1.Text = text;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.NaytaTeksti = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// NaytaTeksti
//
this.NaytaTeksti.Location = new System.Drawing.Point(80, 88);
this.NaytaTeksti.Name = "NaytaTeksti";
this.NaytaTeksti.Size = new System.Drawing.Size(128, 23);
this.NaytaTeksti.TabIndex = 0;
this.NaytaTeksti.Text = "Nayta";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(96, 120);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 1;
this.textBox1.Text = "";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.NaytaTeksti);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}
|
|
|
|
|
Hi,
you have to add the following line into your InitializeComponent Method
this.NaytaTeksti.Click += new System.EventHandler(this.NaytaTeksti_Click);
otherwise your Event Handler is never called.
Regards,
Jens
|
|
|
|
|
Hi,
As JF2015 said, there is a line missing.
However, when using Visual Studio, you are not supposed to edit tje InitializeComponent() method, it is generated and managed by Visual Designer.
So either use the Visual Designer to add a click event to your button, or add the new line to your Form1 constructor, right after the call to InitializeComponent().
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
kiddo…… NaytaTeksti_Click(object sender, EventArgs e)
this event dosn't belong to any Control
here:
this.NaytaTeksti.Location = new System.Drawing.Point(80, 88);
this.NaytaTeksti.Name = "NaytaTeksti";
this.NaytaTeksti.Size = new System.Drawing.Size(128, 23);
this.NaytaTeksti.TabIndex = 0;
this.NaytaTeksti.Text = "Nayta";
this.NaytaTeksti.Click+=new System.EventHandler(this.NaytaTeksti_Click);//please add this
Who knows most speaks least
|
|
|
|
|
Hi! Is there a way to acquire the letters from the grid of this game:(it is in Bulgarian)
The game is:http://bezumie.com/dumino/[^]
In the text field you write a player name. Then you click the button next to it - "ВХОД". When the page loads there is a grid, which eventually fills with Cyrillic characters. How can I get the characters with a C# application???
Via Firefox I saw the page source. There is a board array which contains the characters. But I don't know how to access the information with my program.
Still learning...
|
|
|
|
|
well, this is bad idea to do this on sites...but a little hint, that input element id is 'fld'.
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
|
|
|
|
|
Hello everybody
i have a treeview it has set of nodes , i want to set some of them visable to false , but i can't find visable or enable proprty
what can i do please
thnks for help
M.Elkholy
MD_NADA
|
|
|
|
|
no, there is no property exists in TreeView to hide a node but you can remove a node.
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
|
|
|
|
|
thanks for your replay
but i need the nodes hiden i cant remove it becouse i depend on it in my code
MD_NADA
|
|
|
|
|
Just because you need the nodes hidden doesn't mean that you can do it - you may need to investigate a third party control to see if you can find this feature there.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|