|
thanx all problem solved...
|
|
|
|
|
actually the form2 was getting disposed before setting its control's text...
|
|
|
|
|
Oops.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
you can use delegation to solve your problem
EASY COME EASY GO
|
|
|
|
|
Hi..
I try to insert 2 textbox text in one field but i face a problem please help me
my code is
SqlConnection conn = new SqlConnection(connString);
string v_query = "insert into voucher_2 (heads,credit,debit,descp,vdate) values('" + partyname.Text + "',' 0 ','" + Amount.Text + "','" + qty.Text && rate.Text + "','" + Date.Text + "')";
SqlCommand cmd = new SqlCommand(v_query,conn);
try
{
conn.Open();
cmd.ExecuteNonQuery();
MessageBox.Show("Record Inserted.");
}
finally
{
conn.Close();
}
Error IS
perator '&&' cannot be applied to operands of type 'string' and 'string'
|
|
|
|
|
Ofcourse, && is Logical AND operator.
You can use + operator to combine two strings.
|
|
|
|
|
What are you trying to acheive?
If you want to concatenate two strings, then use the '+' operator.
qty.Text + rate.Text
|
|
|
|
|
Thanks For Good And Fast reply
|
|
|
|
|
How to create spaces between them???
|
|
|
|
|
qty.Text + " " + rate.Text
|
|
|
|
|
qty.Text + " " + rate.Text
|
|
|
|
|
how to use brain cells?
how to read book?
how to ask questions?
|
|
|
|
|
try declaring a string variable and pass the value of two textbox.text in the declared variable...
string strTxtVal = "";
strTxtVal = qty.Text + rate.Text;
|
|
|
|
|
Dear friends ,
I have Problem like these ...
i have C++ dll which returns "unsigned char *" - this contains image data
now i want that to be converted to c# "byte[]"
how to do that???
thank you
|
|
|
|
|
|
Dear friend
thank for the reply
and few clarification,
"unsigned char *" is a pointer array and is it possible to assign to simple char[] of c# without any address as such ??
unsigned char* buffer = new unsigned char[xSize*ySzie]; //Type in C++
byte[] ImageData =buffer; //C#
throws error as "Cannot implicitly convert type 'byte*' to 'byte[]",
do i need to change byte[] ImageData to byte[]* ImageData
Thank you
|
|
|
|
|
|
Hi,
you can't convert an unsigned char * (or any other pointer) to a byte[] or any other kind of array, as an array has a length which is not available when all you have is a pointer.
the easiest way to transfer an array of elements between managed and unmanaged worlds is by having the managed world create the array and the native side to read/write said array. Which means the array's size must be known beforehand, and the array should be passed as a parameter.
|
|
|
|
|
I have a web address which when run in a web browser returns a xml file.
i need to save that file as xml format.
i have tried using webclient.downloadfile method but its not saving the full file, it only saves two lines.
please if any one can explain how to do it.
|
|
|
|
|
Perhaps your application isn't waiting for the entire content to be downloaded?
/ravi
|
|
|
|
|
You can download web pages using the HttpWebRequest and HttpWebResponse classes. My CP Vanity[^] article holds an example in its downloadPage() method.
|
|
|
|
|
hi,
thanks for your reply,
this is my code, till the content it returns fine but does not save the file in the drive.
how do i make it to save it on the hard disk.
thanks
rssDoc = new XmlDocument();
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(value);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
Stream stream = resp.GetResponseStream();
StreamReader reader = new StreamReader(stream, Encoding.UTF8);
string content = reader.ReadToEnd();
rssDoc.LoadXml(content);
rssDoc.Save("c:asp.xml");
|
|
|
|
|
Hi,
two comments:
1.
aforaries wrote: rssDoc.Save("c:asp.xml");
this is not correct; it needs a backslash after the colon, either insert two backslashes (as one will be ascaped) or use the @ sign:
rssDoc.Save(@"c:\asp.xml");
Furthermore, the top folder of the main partition isn't writable on modern Windows versions (Vista, 7).
2.
content contains the string you received; the easiest way to save that to a file is by using
File.WriteAllText(filespec, content);
That is also the way that assumes content is text, no more, no less; it does not require it to be valid XML; your way of doing things does require valid XML, otherwise rssDoc.LoadXml(content); will fail.
|
|
|
|
|
Hello everybody,
I develop a GMAO csharp smart device application using Visual studio 2008.I try to show my data stocked in my tables in my database .sdf.I use DataGridView tool.I add in the proprietes of my dataGridView the table i wanna show its data.My DataGridViewForm's code is:
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ModeDifféré
{
public partial class DataGridT : Form
{
public DataGridT()
{
InitializeComponent();
}
private void DataGridT_Load(object sender, EventArgs e)
{
this.travauxTableAdapter.Fill(this.baseGmaoLocaleDataSet2.Travaux);
}
private void dataGrid1_CurrentCellChanged(object sender, EventArgs e)
{
}
}
}
But the problem is when running,an error occurs :
<pre>The column name is not valid. [ Node name (if any) = ,Column name = Effectué/Non ]
what is the problem?
Any help will be very helpful
Regards
|
|
|
|
|
We only see the partial class, so we don't see the generated code, but based on your error message, I'd revisit my column names: your column appears with two special characters : é (e accent aigu) and / (slash). Try renaming your column to something less international (Start with a letter + A combination of letters, digits and _ (underscore).)
|
|
|
|