|
The problem is that you are missing a reference to the XML Namespace torrent from your code. The XML cannot parse this node without this information. Something like this should help
var ns = new XmlNamespaceManager(doc.NameTable);
ns.AddNamespace("torrent", "http://xmlns.ezrss.it/0.1/");
|
|
|
|
|
Hi all,
I need some help since I searched thru all of the blogs and could not find the answer. I have the following code in C# and will like to call ONPaint() in the DrawEventHandler(object sender, DrawHandler.DrawEventArgs e)
I get this error:
Error 1 The best overloaded method match for 'System.Windows.Forms.Control.OnPaint(System.Windows.Forms.PaintEventArgs)' has some invalid arguments
Error 2 Argument '1': cannot convert from 'mobile.DrawSHandler.DrawEventArgs' to 'System.Windows.Forms.PaintEventArgs'
namespace mobile
{
public partial class SV : UserControl
{
code for declaring variables
public SV()
{
code........
}
private void DrawEventHandler(object sender, DrawHandler.DrawEventArgs e)
{
OnPaint();
}
protected override void OnPaint(PaintEventArgs e)
{
Bitmap b = new Bitmap(this.Width, this.Height);
Graphics g = Graphics.FromImage(b);
Brush bg = new SolidBrush(BackColor);
Region bgr = new Region(new Rectangle(0, 0, this.Width, this.Height));
g.FillRegion(bg, bgr);
DrawBg(g);
DrawSV(g);
e.Graphics.DrawImage(b, 0, 0);
b.Dispose();
g.Dispose();
}
protected void DrawBg(Graphics g)
{
code........
}
protected void DrawSV(Graphics g)
{
code........
}
}
}
|
|
|
|
|
You can't just omit parameters; the compiler will look for a method without parameters and says, correctly, that there is none.
Call <a href="https://msdn.microsoft.com/en-us/library/598t492a(v=vs.110).aspx">Invalidate</a>[<a href="https://msdn.microsoft.com/en-us/library/598t492a(v=vs.110).aspx" target="_blank" title="New Window">^</a>] to have the control repaint.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
thanks, this works
private void DrawEventHandler(object sender, DrawHandler.DrawEventArgs e)
{
this.Invalidate();
}
|
|
|
|
|
hi all,
i have a form that have a container.
in the container - datagridview and button
container is hortizal
name of this form: MAIN
button event click:
duplicate MAIN form
but i want that the container will be vertical in the duplicate form
how i can do this??
thanks you
|
|
|
|
|
Add a default parameter to the main form constructor:
public frmMain(bool IsHorizontal = true)
{
InitializeComponent();
...
}
Then check the value in the constructor and orient your container appropriately.
When you want a vertical container:
frmMain fm = new frmMain(false);
fm.Show();
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
how i do when IsHorizontal=true
then the frm will show but VERTICAL
|
|
|
|
|
|
Hi All,
How to create PPPoE connection after clicking button in c#. I have ready form with two textbox(username and password)fields. I want to create PPPoE Connection, place shortcut on desktop and copy username and password from fields to PPPoE connection after clicking button in form.
Thanks for Helping.
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
modified 16-Mar-15 10:46am.
|
|
|
|
|
And?
What have you tried?
Where are you stuck?
What help do you need?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
Don't post this here - if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I want to write multiple attributes and their values in single node without closing tag in c#.
|
|
|
|
|
And at which point did you run into a problem?
Recursion: see Recursion.
|
|
|
|
|
If you had a question, we could help. As is, I can only wish you good luck with your intention
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
XElement request = new XElement( "IntlRateV2Request",
new XAttribute( "USERID", _username ),
new XAttribute( "PASSWORD", _password )
);
request.Add( new XElement( "Revision", "2" ) );
etc.
|
|
|
|
|
please can you tell us what have you tried and where you are stuck?
|
|
|
|
|
I'm working on an assignment that requires a simple data transfer data of a SQL Server to MS Excel; using C#. I was able to develop the "foundation" of what I believe works/ However I'm unable to run the program. Assistance is appreciated!
namespace ProjectLab1
{
class Program
{
static void Main(string[] args)
{
string conString = "Driver={MySQL ODBC 5.3 ANSI Driver};"
+ "Server=devry.edupe.net;Port=4300;"
+ "Database=Inventory_XXXX;"
+ "uid=XXXX;pwd=DeVry_Student";
OdbcConnection connection = new OdbcConnection(conString);
connection.Open();
string theQuery = "SELECT * FROM item i, inventory v where i.invent_id=v.invent_id";
OdbcDataAdapter DataAdapter = new OdbcDataAdapter(theQuery, connection);
DataSet theData = new DataSet();
DataAdapter.Fill(theData, "item");
DataTable theTable = theData.Tables[0];
Console.Write("ITEM".PadRight(30));
Console.Write("QUANT".PadLeft(10));
Console.Write("SIZE".PadLeft(10));
Console.Write("COLOR".PadLeft(10));
Console.Write("PRICE\n".PadLeft(10));
Console.WriteLine("-".PadLeft(70, '-'));
foreach (DataRow dataRow in theTable.Rows)
{
Console.Write(dataRow["invent_desc"].ToString().PadRight(30));
Console.Write(dataRow["qoh"].ToString().PadLeft(10));
Console.Write(dataRow["itemsize"].ToString().PadLeft(10));
Console.Write(dataRow["color"].ToString().PadLeft(10));
Console.WriteLine(((decimal)dataRow["curr_price"]).ToString("C").PadLeft(10));
}
{
StreamWriter file = new StreamWriter(@"C:\Users\redfaction\Desktop\Data\" + strFileName);
file.WriteLine(sb.ToString());
File.Close();
connection.Close();
}
}
}
}
modified 17-Mar-15 4:58am.
|
|
|
|
|
Member 11527519 wrote: I'm unable to run the program.
Care to be more specific? How is anyone supposed to know what you mean by that?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I'm sorry about that. The main issue here is that the code simply doesn't work and I've tried different ways to make a cmd-based program take a .sql file and export the data as a MS Excel file - as end result. Out of all the attempts I've made; this is the closest I've gotten but I'm unable to run the program due to a small number of errors I'm not familiar with. If possible I would appreciate it if you took a look at the code though a program like Visual Studio.
|
|
|
|
|
Have you tried the writing to excel using the interop and you are connecting using MySQL odbc. is your db really sql server?
|
|
|
|
|
Yes, it is a server that is holding SQL Datatables on a cloudserver that can be connected using ODBC. I'm able to connect to this server (that I have done before using cmd-based program to simply see particular tables, which HAS worked) I'm just simply trying to figure out how to export the data to MS Excel, by making a CSV file.
|
|
|
|
|
What are these small number of errors? Are they compilation errors? Are they runtime exceptions?
|
|
|
|
|
There are about 6 errors in total; But 5 are name errors giving the message of "ddlExportFormat, strFormat, ds and connection does not exist in current content". I felt like within the code I posted above they where accurately addressed towards their methods. and the Last error address a System.IO file saying
|
|
|
|