|
How to read e-mail from server from my application and then parse XML attachment?
Vlada Nesic
|
|
|
|
|
Hi Vlada,
have a look at this article within CodeProject:
http://www.codeproject.com/csharp/despop3client.asp
This article covers how to obtain mails from an email server.
If you have any further questions, don't hesitate to post again.
Regards
Sebastian
|
|
|
|
|
Can you help me? I need some information to use c# parallel port? 'cause I haven't found nothing in Net... Thx
|
|
|
|
|
There is nothing in the .NET BCL to talk to the parallel port directly. You have to use a 3rd party library to do this, such as http://www.logix4u.net/[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You should use this library...
I can't remember what it's called. I used it some while ago for some parallel port, C# action.
Uh.... If I remember i'll post it.
/\ |_ E X E GG
|
|
|
|
|
Thank you Eggie5! I BELIVE IN YOU (for me it's very important, I'll wait your response) see ya
|
|
|
|
|
|
Hello,
I want to make a Dock-able window (like Solution explorer in the VS .NET IDE). any ideas how can I do it?
any help is much appriciated, Thanks in advance...
- A programmer's national anthem; "AAAAAHHHHH!!!!"
|
|
|
|
|
|
Hello,
Thanks for your reply Grundyfoot, but there are a couple of concerns:
o Actually I want to learn the technique myself, so don't want to use any third party libraries...
o Even If I go for a 3rd party library, The money they ask for is beyond my budget...
Thanks for your help anyway.
- A programmer's national anthem; "AAAAAHHHHH!!!!"
|
|
|
|
|
Hello,
I'm trying to go to a webpage that a user gives in into a textbox, so what I want to do is :
Read an url from a textbox and submit it in a new window, by using a linkbutton next to the textbox.
Someone can help me with this please ?
I allready can startup this url from a datagrid, so that's no problem.
tnx.
karin.
|
|
|
|
|
You can't open a new window using asp.net, as the asp.net code is executed in the server. You have to use client script for that.
Example:
<input type="button" value="open" onclick="window.open(document.getElementById('IdOfTheTextbox'),'_blank');">
---
b { font-weight: normal; }
|
|
|
|
|
Hai,
How can i list all machines in the network.
If u have any idea plz help me
Thanks in Advance
Anish
|
|
|
|
|
The search function is always handy :
http://www.codeproject.com/csharp/csenumnetworkresources.asp
|
|
|
|
|
Hi,
I am trying to call a Fortran dll in my simple C# example.
My Fortran bit looks like this:
'code'
subroutine sumit(x,i,r)
real , intent(in) :: x(i)
integer , intent(in) :: i
real , intent(out) :: r
!
!DEC$ATTRIBUTES STDCALL, DECORATE dllexport :: sumit
!DEC$ATTRIBUTES STDCALL, DECORATE, ALIAS:'sumit' :: sumit
!
integer :: j
r=0.0
do j=1,i
r=r+x(j)
end do
end subroutine sumit
'code'
and my C# bit looks like:
'code'
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication1
{
class MyClass
{
[DllImport("Dll1.dll", EntryPoint="sumit")]
public static extern double sumit(double x,int i,double r);
public static void Main()
{
sumit(10.0,10,0.0);
}
}
}
'code'
But I get an exception error System.NullReferenceException.
I also tried to add reference but I get an error saying that the extension must be of type .dll but it is already.
Can anyone help.
Kash
|
|
|
|
|
|
hi
i did this:
in my Access db table, i've rows of data. each row have columns (i've a column representing ID number and other columns for other data). in VS, i've a textbox for the user to enter an ID number and then press OK button.
how to do this:
the pressing of OK button should retrieve the entire row of data belonging to THAT ID number keyed in and then displaying the data in a form in VS.
do i have to do anything regarding filtering, parameters or setting criteria?
can i have some sample codes/examples?
thanks very much!
|
|
|
|
|
You send a query to your Access Database to request the row. Something like this:
OleDbCommand cmd = new OleDbCommand(myConnection,
"SELECT id, dataColumn1, dataColumn2, etc FROM myTable WHERE id = ?")
cmd.Parameters.Add(id);
OleDbDataReader reader = cmd.ExecuteReader();
int id = reader.GetInt32(0);
string myValue = reaser.GetString(1);
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
sorry for my ignorance but how do i actually go about to send a query?
|
|
|
|
|
That is what the code I gave you does. It sends the query to the database and retrieves the result. Here is again, but annotated more fully.
OleDbConnection myConnection = new OleDbConnection(myConnectionString);
myConnection.Open();
OleDbCommand cmd = new OleDbCommand(myConnection,
"SELECT id, dataColumn1, dataColumn2, etc FROM myTable WHERE id = ?");
cmd.Parameters.Add(id);
OleDbDataReader reader = cmd.ExecuteReader();
int id = reader.GetInt32(0);
string myValue = reaser.GetString(1);
myConnection.Close();
Also, the MSDN documentation will explain each of these classes and methods with further examples.
* DISCLAIMER: I typed this by hand without running it through a compiler. There may be some small errors.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
oh thanks so much for a more detailed description! it's more clear to me what those codes mean now. =)
but what i meant was what actually are the steps to send a query to my database? what am i supposed to click on to enter those codes that you have shown me?
>sorry im new to database stuff and i really need some help in making things work.. and seriously, i learn better this way, through step by step guidance and hands-on experience.. nevertheless, i'll be reading up on the relevant links that may be helpful..
thanks again! =)
|
|
|
|
|
nidhelp wrote:
but what i meant was what actually are the steps to send a query to my database?
The steps are those I've shown you above.
nidhelp wrote:
what am i supposed to click on to enter those codes that you have shown me?
Umm... The text editor. Then you start typing. (I know that sounds a stupid answer, but there is nothing to click on. No magic buttons to press. You really have to do the work).
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
SORRY im still stuck...i cant figure out where to type the codes. which section of my program should i type?
THANKS!
|
|
|
|
|
There are many ways to do this. One of the correct ways is to create a DAL (Data Abstraction Layer) in your application. This is really just a class, or set of classes (if your application is big) that communicates with the database for you. It then returns the data to what ever part of the application needed it.
e.g.
class Dal
{
private string connectionString;
public Dal()
{
connectionString = ConfigurationSettings.AppSettings["connectionString"];
}
private SqlConnection Connection
{
get
{
return new SqlConnection(connectionString);
}
}
public Hashtable GetMyData()
{
Hashtable result = new Hashtable();
for(int i=0; i<myDataReader.FieldCount;i++)
{
string columnName = myDataReader.GetName(i);
object columnValue = myDataReader.GetObject(i);
result[columnName] = columnValue;
}
return result
}
}
Then somewhere in the code that needs the data from the database you can write something like this:
Dal dal = new Dal();
Hashtable data = dal.GetMyData();
Does this help?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Hey! I've done something similar to this and i know just how you feel. My suggestion is that you separate your queries (data gathering from database) from you UI form. Create another form which would contain your connection string as well as all your queries then pass it to your main form.
Try this:
public class DS_Company<br />
{<br />
OdbcConnection conn = new OdbcConnection("ConnectionString");<br />
string strSQL;<br />
<br />
public DS_Company()<br />
{<br />
conn.Open();
}<br />
<br />
public DataSet GetID(string strID)<br />
{<br />
strSQL = " SELECT ";
strSQL += " * ";
strSQL += " FROM Table";
strSQL += " WHERE IDnumber='"+ strID +"'";
<br />
DataSet ds = new DataSet();
OdbcDataAdapter adpDS = new OdbcDataAdapter(strSQL,conn); <br />
adpDS.Fill(ds);
return ds;
}<br />
}<code><br />
<br />
hope that helps <br />
<br />
Kampai!!!
|
|
|
|