|
Hello!
I am trying to catch a reminder and incoming mail of the outlook...
I am able to catch them, but the problem is that I can't see the content
of the mail, or the content of the reminder...
Maybe someone knows how I can check it?
(I'm programming in .NET 1.1)
Any help would be appreciated!!!
Thanks in advance!
|
|
|
|
|
Hi,
I am getting a byte array from a string using Encoding.UTF8.getBytes(string) function. Now i convert it to a string using Encoding.UTF8.getString(byte[]). Now when i convert it back to byte array using above mentioned function,i don't get the same array that i used when converting to string. Please guide me in this regard.
Waiting from replay...
|
|
|
|
|
If that is really so, it sounds like something that is very specific to what you are doing. I'm not even convinced that the unicode conversion is the actual problem.
Can you show an example that will produce this unusual behaviour?
---
b { font-weight: normal; }
|
|
|
|
|
hi
im using axAcroPDF to display the Pdf file on my windows form. im able to display the pdf file in my form but i dont want the tool bars of PDF file to be displayed. i just want the pages of PDF file. how can i customize this?
Rajanikanth A.B
|
|
|
|
|
I am opening a MS Word document using the following C# code.
Word.ApplicationClass WordApp = new Word.ApplicationClass();<br />
<br />
if (this.openFileDialog1.ShowDialog() == DialogResult.OK) <br />
{<br />
object fileName = openFileDialog1.FileName; <br />
object readOnly = false; <br />
object isVisible = true;<br />
<br />
object missing = System.Reflection.Missing.Value;<br />
<br />
WordApp.Visible = true;<br />
<br />
Word.Document aDoc = WordApp.Documents.Open(ref fileName, ref missing,ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible);<br />
<br />
aDoc.Activate();<br />
}
This works fine and it opens the document in MS Word separate from the C# application. Is there a way of hooking an event to the document object (aDoc) so that when the word document is closed the C# application can react to the event?
Thanks
Kobus
|
|
|
|
|
Hi.
You should see the common task in windows XP, that appears in left side of all windows(like My Computer , My Documents , ...), and when in a window (My Computer, for example) at "Tools menu -> Folder options ... -> General Tab -> Show common tasks in folders" is selected, it appears.
OK?
I need a control like this to use, that has several portions and each portion expand and enclose like common tasks.
Anything can help me?
Best wishes
|
|
|
|
|
There are several samples here on CP. I cant recall what they are called, perhaps 'Collapsable Control/Container'.
|
|
|
|
|
|
i am using command object where i execute an insert statement,it executes fine but when i open the table then there is no data present. iam using client mode sql database in visual studio 2005.
please help me
sunny
|
|
|
|
|
Then it's either not executing fine, or you are not looking for the data in the right place. A normal input statement either adds a record or causes an exception when it's executed.
So, most likely you are mistaken in some way, and one of these three things happen:
:: The query is not executed at all.
:: There is an exception, but your code is catching and ignoring it.
:: The data is there, but you look in the wrong place.
---
b { font-weight: normal; }
|
|
|
|
|
hi all,
What is the most Efficient way when using Data Reader and DataSet.?
I have read some articles and they says that Data Reader is Efficient than DataSet.
Now I m giving two samples using DataReader and DataSet.
sample 1 using DataReader)
SqlDataReader dataReader=sqlCmdGetFareList.ExecuteReader();
while(dataReader.Read())
{
FareList farelist = new FareList();
farelist.FareID= dataReader.GetInt32(0).ToString();
farelist.AirlineName = dataReader.GetString(1);
farelistArray.Add(farelist);
}
I'm going to do same procedure using DataSet.
sample 2 using DataSet)
DataSet lobjDataSet=new DataSet("Temp");
DataTable lobjDataTable=new DataTable("DTTable");
SqlDataAdapter lobjSqlAdpt=new SqlDataAdapter(_sqlComm);
//fill DataSet
lobjSqlAdpt.Fill(lobjDataSet);
//fill dataTable
if(lobjDataSet.Tables.Count>0)
lobjDataTable=lobjDataSet.Tables[0];
foreach(DataRow dr in lobjDataTable.Rows)
{
FareList farelist = new FareList();
farelist.FareID= dr["FareID"].ToString().Trim();
farelist.AirlineName = dr["AirLineName"].ToString().Trim();
farelistArray.Add(farelist);
}
In theory says that dataReader is fastest than DataSet.but in here you can see that there is loop in both Sample 1 and Sample 2.
So when considering entire code in sample1 and sample2, can any one please tell me what is the fastest and efficient way to data Retrieve from DB?
Thanks in advance...
|
|
|
|
|
The first one, of course.
The data adapter is basically just reading the data and creating an object structure in memory containing the data. As you are not using any of the added functionality of the data set, this is only wasting time and memory resources.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa is totally right. The fact that you see one loop in both examples doesn't mean anything. You can be sure that the Fill call to the DataAdapter contains another loop. Furthermore you should always consider that one loop may be more/less cost intensive than another one. If you are not sure some logging of the times while running is always helpful. Testing/profiling is always the most secure way to determine which alternative is the best.
|
|
|
|
|
|
Make a public Save method on your MDI child form and then obtain a refrence to the active child form from parent and call the Save method.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hello,How to set a DataGrid's style(DataGridColumnStyle) when It's DataSource is a DataView?
I can do it when DataGrid's DataSource is a DataSet or DataTable.
Can you Help me?
Thanks a lot.
DataGridColumnStyle
-- modified at 22:47 Sunday 9th April, 2006
|
|
|
|
|
I Have know the answer,Thanks everyone.
hello
|
|
|
|
|
Hey,
i want to do some overloading but i cannot find out how to get the object type to be right.
The problem is the following.
I have a Base class called Animals, and then i have a couple of sub classes which inherit from the Animal class (etc. Dog, Cat and soo on).
I Create my Dog and Cat objects and add them to an ArrayList.
For controlling the ArrayList i have a couple of Methods, one of them is GetAnimal();, which will return a object from the ArrayList. But as it is different what type of objects which is returned it seems that i have to return object of type Animal (the object casted).
I have a class which computes some movement and stuff.
In that class i want to Get an object (GetAnimal()) and call a method, like this.
public void Compute() {
Move(GetAnimal());
}
and then i have Move Methods for every Animal
public void Move(Dog dog) { doSomething }
public void Move(Cat cat) { doSomething }
But my problem is that when i make the GetAnimal() call i get the object as Animal and not as the Correct type needed for overloading. Soo it complains about there is no correct method for overloading.
What am i missing / doing wrong ?
What should i do to get the object as the correct type which i can use when calling the overload methods
I could of course place the methods on the objects and make it abstract instead, but it isnt reall what i want.
Hope someone can help me with this.
Best regards
Martin
|
|
|
|
|
Time to understand the difference between overloading and overriding. Method overload resolution happens at compile time, so the compiler sees that you call Move with an instance of Animal and that there is no method that takes it as a parameter. Virtual method dispatch, which you can achieve by declaring Move virtual or abstract, happens at run time, based on the runtime type of the object returned by GetAnimal. Because the compiler cannot possibly figure the actual type of the object returned by GetAnimal, it can only assume what you've declared i.e it returns Animal.
So no, you cannot do what you want using overloading, unless you return explicit types (GetCat(), GetDog(), for eg.).
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
Thanks for the answer.
I decided to go with the abstract solution as i could probably come in handy later on.
I guess it would have worked if i used the ArrayList with the objects directly and just did something like
Move(theArrayList[index]); -- hmm i am sure i once found an articel on this site about this ... hmm
Best regards
Martin ...
-- modified at 22:16 Tuesday 11th April, 2006
|
|
|
|
|
Hi,
Please see the following code below:
//////////////////////////////////////////////
.....
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
xOrigin = Form1.ActiveForm.ClientRectangle.Width/2;
yOrigin = Form1.ActiveForm.ClientRectangle.Height/2;
DrawThisLine(e.Graphics);
}
public void DrawThisLine(Graphics g)
{
Pen pen = new Pen(Color.Black, 3);
g.DrawLine(pen, xOrigin, yOrigin, xOrigin + 75, yOrigin + 75);
}
private void timer1_Tick(object sender, System.EventArgs e)
{
}
....
///////////////////////////////////////////
I have tried to use the timer1 object and the timer1 event but can't seem to get the line to move around on the Form1. Ultimately I'd like it to rotate around like a clock hand but at this point I'll take any code fragment just to get it in some sort of animated motion.
Thanks a lot in advance....
|
|
|
|
|
Well, as you are not doing anything in the timer event, you can't expect much to happen.
Do some changes to what you are drawing, and cause a redraw:
something += whatever;<br />
this.Invalidate();
You might want to do the drawing on something like a panel, though, so you don't have to redraw the entire window for every update.
---
b { font-weight: normal; }
|
|
|
|
|
THanks,
I intentionally left them blank.
I think my main confusion is the fact that I have to do all the drawing in the paint handler. Once i added the timer event I can't figure out how to tie the the paint event to the timer and the function that draws the line in the paint event.
|
|
|
|
|
That's what the Invalidate call is for. It causes a repaint.
---
b { font-weight: normal; }
|
|
|
|
|
This is my problem, it seems pretty tough.
I have an XML file that is structured like this
<code>
papers
--paper
----id
----title
----tracks
-------track
-------track
-------track
--paper /
--paper
.
.
.
papers /
</code>
SO basically a bunch of paper nodes, each with a track node that has multimpe track chrildren.
So display this data on my page using a repeater
<pre> <asp:repeater id="RepeaterReviewers" runat="server">
<ItemTemplate>
<div class="reviewerListItem">
<div>
<span class="bold"><%# Container.ItemIndex + 1%> </span><%# XPath ("name") %>
(<a href='mailto:<%# XPath ("email") %>'><%# XPath ("email") %></a>)
</div>
<div>
<%# XPath ("affiliation") %>
-
<%# XPath ("country") %>
</div>
<div>
<span>Tracks: <%# XPath ("tracks") %> </span>
</div>
<div><span>
Currently Reviewing: </span><span class="bold"> <%# XPath ("count(papers/id)") %></span>
</div>
</div>
</ItemTemplate>
</asp:repeater> </pre>
but my problem is, I only know how to get back one node using <code><%# XPath ("tracks") %></code> using this syntax. How can I get the value of track nodes inside of tracks????. Remember, I am using a repeater...
/\ |_ E X E GG
-- modified at 16:02 Sunday 9th April, 2006
|
|
|
|