|
XDocument is for LINQ. I have used XmlDocument .
Best wishes,
Navaneeth
|
|
|
|
|
Thanks man, works great. Been waiting all day for a reply. Is there a way to check a directory for the file name and only display those that exist? Or do I need to display them all all the time? I knwo I am way overcomplicating this but once I figure this out I should be ok for the rest of my application. I think. Would you be able to put detailed comments in your code for me to understand better please?
I tried to add
if (File.Exists(PathVariable + Filename))
before the output but as soon as I do I get no output at all.
modified on Monday, October 19, 2009 1:31 AM
|
|
|
|
|
Yes. File.Exist() is the way to check the file existence. But I don't understand what issue you are facing here.
Best wishes,
Navaneeth
|
|
|
|
|
hi,
i am trying to use the borzoi 1.02 with Visual studio 2008 C# .NET,
i am trying to use the ECC implementation in this library,
so how can i integrate this library and use its functions from within VS 2008 C#.
thanks alot
|
|
|
|
|
What on earth are you talking about ? What makes you think we would know ? What is the library written in ? If it's not .NET, if it's a dll, you can use pinvoke to write a wrapper.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
If two client calls the same method, second client is waiting for the first client finished on WCF.
For example;
Client1 --CALL--WCF--> Metod_A
Client2 --CALL--WCF--> Metod_A
Metod_A spend 20 second for process. Client2 wait 20 second due to Client1.
I try, InstanceContextMode; PerSession, PerCall or Single. And I try ConcurrencyMode = ConcurrencyMode.Multiple but all of them give same result. Allways Client2 wait 20 second due to Client1.
How can I remove waiting time.
Note: Metod_A retrun value. So I can't use IsOneWay=true etc... And I don't want use thread.
Thanks...
modified on Sunday, October 18, 2009 5:46 PM
|
|
|
|
|
dataminers wrote: Metod_A spend 20 second for process
I strongly recommend you consider a redesign of your service. A service that takes 20 seconds to execute is far from scaleable as you've already seen with just 2 concurrent clients.
You should consider converting the service to one that requests that the operation be performed (in a separate thread) and returns quickly (after submitting the request). You'll also need APIs to check if the request has finished, and get the returned results (or error status).
/ravi
|
|
|
|
|
20 is just a example. Why second client wait due to first client when call same metod in WCF.
|
|
|
|
|
How are you starting your service host? Are you using a single instance of the service class or are you passing the service type to the ServiceHost constructor?
In the service code, there is some call to synchronization methods or some external API that could cause concurrent execution to block?
Edit: another possibility: are you executing SQL queries with transactions?
modified on Monday, October 19, 2009 6:37 AM
|
|
|
|
|
hi, I created a custom control and put textboxes in it.Even though I can use the events of textboxes, I can't use the events of the custom control itself. Any way to do it? Thanks
|
|
|
|
|
So long as you subscribe to the events properly and attach handler methods it should be no problem
using System;
using System.Drawing;
using System.Windows.Forms;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
MyControl myControl = new MyControl();
Controls.Add(myControl);
myControl.BackColorChanged += new EventHandler(myControl_BackColorChanged);
myControl.BackColor = Color.Black;
}
void myControl_BackColorChanged(object sender, EventArgs e)
{
MessageBox.Show("Handler for myControl");
}
}
public class MyControl : UserControl
{
public MyControl()
{
BackColorChanged += new EventHandler(MyControl_BackColorChanged);
}
void MyControl_BackColorChanged(object sender, EventArgs e)
{
MessageBox.Show("Handler for own event");
}
}
|
|
|
|
|
Thanks for the code Dave but I think I couldn't explain well.Here is more detail;
I created a custom control and put a normal textbox in it and placed this custom control on a form. When the form is running, all I want is When I click on the textbox, I want to use the click event of the custom control,not the textbox.
thanks
Also, I use singleton for the form if that differs
|
|
|
|
|
When you click in that textbox, only the textbox's Click event is going to fire. You didn't click on the surface of the custom control so its Click event won't fire. In order for the Form to see the TextBox's Click event, you're going to have to handle the Click event in your custom control and, in that event handler, Raise your custom controls Click event.
|
|
|
|
|
|
I have an application that is (should) save blobs in the database. It saves all the columns except the blob. I have been trying everything I can think of. If anyone has something to try, please let me know. I keep telling myself this should not be hard. Thanks in advance.
Here is the table (SQL Server 2005).
CREATE TABLE [dbo].[publication] (
[id] INT IDENTITY(1,1) NOT NULL,
[title] VARCHAR(50),
[category] VARCHAR(50) NULL,
[orig_file_name] VARCHAR(255) NULL,
[publish_date] DATETIME NOT NULL DEFAULT(GETDATE()),
[data] IMAGE NOT NULL,
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
Here is the code.
public static int uploadPublication(string title, string originalFileName, DateTime publishDate, string category, System.IO.Stream publication)
{
byte[] publicationData = new byte[publication.Length];
publication.Read(publicationData, 0, Convert.ToInt32(publication.Length));
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ClubSiteDB"].ConnectionString);
SqlCommand command = new SqlCommand("INSERT INTO publication (title, orig_file_name, publish_date, data, category) VALUES ( @title, @orig_file_name, @publish_date, @data, @category); select SCOPE_IDENTITY()", connection);
SqlParameter param0 = new SqlParameter("@category", System.Data.SqlDbType.VarChar, 50);
param0.Value = category;
command.Parameters.Add(param0);
SqlParameter param1 = new SqlParameter("@title", System.Data.SqlDbType.VarChar, 50);
param1.Value = title;
command.Parameters.Add(param1);
SqlParameter param2 = new SqlParameter("@orig_file_name", System.Data.SqlDbType.VarChar, 255);
param2.Value = originalFileName;
command.Parameters.Add(param2);
SqlParameter param3 = new SqlParameter("@publish_date", System.Data.SqlDbType.DateTime);
param3.Value = publishDate;
command.Parameters.Add(param3);
SqlParameter param4 = new SqlParameter("@data", System.Data.SqlDbType.Image);
param4.ParameterName = "data" ;
param4.Value = publicationData;
command.Parameters.Add(param4);
connection.Open();
object result = command.ExecuteScalar();
connection.Close();
if (result != null)
{
return Convert.ToInt32(result);
}
else
{
return 0;
}
}
|
|
|
|
|
|
Thank you very much for the link. The my code is almost line-for-line the same as the example article. Still does not help my problem.
|
|
|
|
|
Then take a closer look. The difference is, mine works, yours doesn't.
only two letters away from being an asset
|
|
|
|
|
Hello all,
Where is what I have done:
1. I have a database(MySQL) with one table.
2. I have my data source made in visual studio(2008)
3. I drop the table unto my form.
So right now I am able to move between records and can add/deleted/update records using the buttons on the binding Navigator control.
But when I add a button to the form to move between records nothing happens. Here is the code I did for the button
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
<br />
this.BindingContext[this.empDataSet, "employees"].Position++;<br />
<br />
<br />
}<br />
Is there a way that I can use both the Navigator control, and use my own buttons at the same time?
|
|
|
|
|
I am not sure, but I think
this.BindingContext[this.empDataSet, "employees"].Position++;
is just a result. You must be initialize this result to navigator control related property.
Best Regards...
|
|
|
|
|
Well the navigator control buttons work.
But am trying to do the samething, but with a normal button.
|
|
|
|
|
Hi.
Ive tried googling for some time now, but havent come across anything that might lead to a solution to my "problem". I guess I aint using the right search phrase.
What I am looking for, is a way to show items on top of a fullscreen playing video. That means, I want listboxes, textfields and alike to show up on top of the video, and these items/elements can be dragged around by the user. The elements should be usable ofc.
Any ideas on what to look for? Or even better, an example?
Thanks alot 
|
|
|
|
|
AFAIK you can only do this with WPF
only two letters away from being an asset
|
|
|
|
|
Thank you, I will look into it 
|
|
|
|
|
I want to be able to pass a string into this procedure to send emails to more than one person. What am I doing wrong?
I keep getting an error that email.cc and email.to are read only fields.
I have tried to pass the parameter into the email = new MailMessage (mailFrom,MailTO)
however I only am able to pass 1 email address into it. I need to be able to pass 7 email addresses into the 1 message. How do I do this?
public static string NET_AuthenticatedMailSend(string mailFrom, string mailTo, string Subject, string MessageBody, string smtpHost, int smtpPort, string smtpNETAuthUser, string smtpNETAuthPassword)
{
MailAddressCollection MailTO = mailTo;
MailAddress MailFROM = Convert. mailFrom;
System.Net.Mail.MailMessage email = new MailMessage();
email.From = MailFROM;
email.CC = MailTO;
email.Subject = "VERSION CONTROL (AUTORESPONDER): " + Subject;
email.IsBodyHtml = true;
email.Body = "VERSION CONTROL (AUTORESPONDER): \n\r" + MessageBody;
System.Net.Mail.SmtpClient mailClient = new SmtpClient();
System.Net.NetworkCredential basicAuthenticationInfo = new System.Net.NetworkCredential(smtpNETAuthUser, smtpNETAuthPassword);
mailClient.Host = smtpHost;
mailClient.Port = smtpPort;
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = basicAuthenticationInfo;
try
{
mailClient.Send(email);
}
catch (Exception ex)
{
MessageBox.Show("Error Sending email: " + ex.ToString());
return ex.ToString();
}
return "1";
}
|
|
|
|
|