|
Yes it works. Thanks a lot.
|
|
|
|
|
Will get u back if i get more doubts.
|
|
|
|
|
this is kinda difficult to phrase, but how can i let a user insert pics into a c# appliaction, and save it so it will show the next time you run the app?
|
|
|
|
|
You have to build a framework yourself, for how you store the image info ( you can't embedd the images in your actual app ), and to display them. For example, an XML file of image paths, and you then build a list from that, and add pictures to the page dynamically based on this list.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
kindly check my little script and tell me. where am I doing wrong?
When i run this script the error arises :
==>> No connection could be made because the target machine actively refused it
thank you
private void button1_Click(object sender, EventArgs e)
{
IPAddress host = IPAddress.Parse("192.168.0.102"); // <<-- my machine ip
IPEndPoint hostep = new IPEndPoint(host, 8000);
Socket sock = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
try
{
sock.Connect(hostep); // <== Error comes from here
listBox1.Items.Add("Connected.");
}
catch (Exception ex)
{
listBox1.Items.Add("Connection problem is :");
listBox1.Items.Add(ex.Message);
textBox1.Text = ex.Message;
sock.Close();
return;
}
try
{
sock.Send(Encoding.ASCII.GetBytes("testing"));
}
catch (Exception exsoc)
{
listBox1.Items.Add("Problem sending data");
listBox1.Items.Add(exsoc.Message);
sock.Close();
return;
}
sock.Close();
}
|
|
|
|
|
Possibly a firewall error or the target IP+port is not enabled.
|
|
|
|
|
Thank you Mr Sarafian
now i have sold my problem
|
|
|
|
|
Hi all,
Thanks in anticipation.
I was working on something that reads a serialized (in vc++) file in c#. So I was using the unsafe sizeof to read or get the size of certain objects. I am providing some code snippet to make the problem comprehensive.
struct Node
{
public struct NodeConsumerSnID
{
Int32 m_nNoOfConsumers;
Int32 m_BranchAboveUniqueID;
}
////////// it is returning 8 Byte
public struct NodeConsumerSnID1
{
Int32 m_nNoOfConsumers;
Int16 m_BranchAboveUniqueID;// int16 or short
}
////////// it is returning 8 Byte
public struct NodeConsumerSnID2
{
Int16 m_nNoOfConsumers;// int16 or short
Int16 m_BranchAboveUniqueID;// int16 or short
}
////////// But it is returning 4 Byte
public struct NodeConsumerSnID3
{
Int16 m_nNoOfConsumers;// int16 or short
Int32 m_BranchAboveUniqueID;
}
////////// it is again returning 8 Byte
Now when I look through the output, sizeof(NodeConsumerSnID) returns 8 byte as expected. Also sizeof(NodeConsumerSnID2) returns 4 byte as expected. But unexpectedly, size0f(NodeConsumerSnID1) and sizeof(NodeConsumerSnID3) returns 8 bytes, whereas the expected value was 6 byte.
Can you please provide me some understanding on the same?
Regards,
Kangkan
-----------------------
Kan...
|
|
|
|
|
The values are padded to be word aligned, I believe. I think there's an attribute you can set to turn this off. Sorry, I don't know what it is, offhand.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks.
The problem is now solved by turning off the alignment.
Regards,
Kangkan
-----------------------
Kan...
|
|
|
|
|
myProcess.StartInfo.Arguments = DataClass2.exc_outputFileName;
I am getting path in exc_outputFileName as @"C:\Ankit\testank";
myProcess.Start();
on myProcess.Start(); it throws error
An unhandled exception type 'System.ComponentModel.win32Exception' occured in system.dll
Additional information :system cannot find ther file specified
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
Try specifying the file extension.
|
|
|
|
|
How can I used SMTP and POP3 protocol for sending and receiving mail.
|
|
|
|
|
Sending email is built into the .NET framework.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have a windows application in dotnet2.0 with sqlserver2000 database.
I m new to c# language.
I m designing a login form.I have kept a checkbox for 'remember password'.
when user cheks it firsttime,nxttime when user enters his userid to login,his password must cum automatically in textbox2.
i have taken a 'bit' field in database for chekbox,if its checked bit will contain 1 else 0
Now what i donno is how to put a value (this chkbit,loginname & pswd)from my login form(a textbox & checkbox) into database.
Can some1 plz help to accomplish this?
U can mail me at nekshan_sweetypie@yahoo.co.in
Thanking Anybody who can help in adv.
Nekshan.
|
|
|
|
|
Nekshan wrote: U can mail me at nekshan_sweetypie@yahoo.co.in
You'll get lots of spam this way, but no replies.
Nekshan wrote: Now what i donno is how to put a value (this chkbit,loginname & pswd)from my login form(a textbox & checkbox) into database.
Why would you want to ? You're checking the login, not setting it, right ?
How new are you to C# ? Do you know another language ? Did you write the database ? How do you do other database access in your code ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thanx graus.
i have checked login,now i want loginid n password which user enters in textboxes into another database.
i m a student of computer science doing project work.
i m trying this code, but no effect :
private void button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=PROGRAMER;Initial Catalog=statusutility;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
con.Open();
cmd.CommandText = "INSERT INTO login(userid,password) VALUES (@pUsername,@pPswd)";
SqlParameter p1 = new SqlParameter("@pUsername", SqlDbType.VarChar, 50);
p1.Value = textBox1.Text;
cmd.Parameters.Add(p1);
SqlParameter p2 = new SqlParameter("@pPswd", SqlDbType.VarChar, 50);
p2.Value = textBox2.Text;
cmd.Parameters.Add(p2);
con.Close();
}
can u plz help on it?
Thank You.
Nekshan.
|
|
|
|
|
You're not executing your query - try cmd.ExecuteNonQuery(); before you close the connection. You might find you also need a cmd.Prepare(); after setting your parameters.
It's also good practice to have your open statement in a try block and your close in a finally block.
Instead of using 3 lines for each of your parameters you can create parameters like this
cmd.Parameters.Add("@value", SqlDbType.VarChar, 50).Value = textBox1.Text;
Hope this helps.
|
|
|
|
|
Well, first use try/catch methods if something doesn't work as you wish, it helps you debugging the application a lot.
I think you should use something like this :
try
{
con.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO login(userid,password) VALUES('"+textBox1.Text+"','"+textBox1.Text+"')");
cmd.ExecuteNonQuery();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.ToString());
}
You can see you aren't using the ExecuteNonQuery function ... maybe that's the problem
regards...
VirtualVoid.NET
|
|
|
|
|
Hi!
Actually i m developing web protal in C# asp.net web application. I want to make EMail client. I have included OpenPOP dll in my project and also its reference. By using OpenPop.Pop3 namespace, how can i receive mails on my server. I m using Kerio mail server. So can anybody guide us how to use the fuctions of this namespace and collect email in my server account.
Thanks
|
|
|
|
|
I am developing application in VS2005 C#, Windows Mobile 5.
Please help, I have some doubts..
1. How to code for softkeys in Windows Mobile?
2. How to add background image?
3.If I closed the application, its still running at the background,I stop running programs also its still running,I need to remove the battery to shutdown the application.How to avoid this?
4.How to install exe file with icon/logo to Windows Mobile programs collection?
I am a newbie for WM development,So, please bear with my questions.
Thanks in advance
|
|
|
|
|
1. Same way as Win Forms. Select the softkey menu in the designer. In Properties change to events view and double click the event you want to handle.
2. Only the PictureBox support BackgoundImage unless you override OnPaint and paint it yourself.
3. That's just the way WM5 handles things. It's 'trying' to be clever. X = minimise not close. You can get apps that override this. I, for example, use sqb Pocket Plus for this.
4. Same way as WinForms. Choose an Icon from the properties of the Form in VS designer.
|
|
|
|
|
Can someone help me regarding my problem.
I want to maintain a database on PocketPC 2002.
What is the database should i choose. can i use MS Access?
i'm developing my applic ation using Visual Stidio 2003 (C#).
Dinesh
|
|
|
|
|
hey i am doin a project on fetching ip address and finding whether there s a mismatch in the ip addrss in the given LAN.. can u please help me out about how to approach this prob?? the platform on which i am workin is c# on dot net..
swetha
|
|
|
|
|
hey i am doin a project on fetching ip address and finding whether there s a mismatch in the ip addrss in the given LAN.. can u please help me out about how to approach this prob??
swetha
|
|
|
|