|
The logic behind writing to the file may be the culprit.
I guess if the order is not important to you, just ignore it!
|
|
|
|
|
|
"Hello" is hardly a question; I can see the question in the subject-line, but it would not have cost you that much time to repeat it in the body and add the code that you're currently working on.
Now, back to the problem, why would you need "multiple" timers?
Imagine you are cooking, and you need to time the eggs (7 minutes) and the pudding (10 minutes). That means you'd use two people, one to warn you after 7 minutes, one after 10 minutes.
Alternatively, you could ask a single person to look at his watch every minute and have him poke you on both the 7-minute marker and the 10-minute marker. That would save the overhead of having to feed another person; or create another object
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
How i can get all instance in special IP in my network.
I have ip address 192.168.0.2 and wanna get all sql instance .
Thanks in advanced!
|
|
|
|
|
Check out SqlDataSourceEnumerator.Instance.GetDataSources method. You can also have a look at this[^] article.
"Fear no factor", Prime Numbers.
|
|
|
|
|
thanks in advanced !
But no use ! Only return SQL Instance of some Ip address. I have 10 Ip(10Pc) but this only return just 1 of them!
What is the solution?
And One more thing.
Some of my SQL Instance doesnt have user/Pass . i mean they are windows authentication(Integrated Security=true) in some IPs.
|
|
|
|
|
Hi,
I have an App.config in my WinForm application. I want to ask if it's possible to output the App.Config file as DLL?
and how?
|
|
|
|
|
You want to magically transform your app.config text file into a DLL? Why?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
to make it protected so no way for anyone to open it and read the contents...
|
|
|
|
|
Would make more sense then to encrypt it. If you add it as a resource then you would have to write it to disk before you could use it, where it would be vulnerable.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
You can read your configuration file by opening it up with ConfigurationManager.OpenExeConfiguration.
|
|
|
|
|
You miss the point of a .config file, it is supposed to be readable.
If you want to protect your settings then move it to a Setting table in the database or use encryption as suggested.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
how can we detect from inside of our own program that
internet connection is now active or not?
|
|
|
|
|
TcpClient has a Connected property. Is that what you are looking for?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
You can call this native function:
InternetCheckConnection[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Fred 34 wrote: how can we detect from inside of our own program that
internet connection is now active or not?
For business applications I doubt that is generally useful. Might never be useful.
You don't care if the "internet" is available. What you care about is if a service is available.
|
|
|
|
|
Just try accessing whatever it is you need to access. Nothing else matters.
|
|
|
|
|
I have a program that uses COM+ EventSystem to pass events around. I was having trouble registering the COM+ component, but it turned out to be a registry permission problem and I got it sorted out to the point that I can now install everything. My Problem is that after installing it the code does not function, but also does not give any errors.
The code was originally written for XP and I am trying to port over to Windows 7. Is there something special about COM+ and EvenSystem in Windows 7.
Thanks
|
|
|
|
|
How can I start in VS-2008 ? Please tell me step by step and give me the link if I need to download any setup file or framework to do so. I have 1ly VS-2008 in my PC.
Yes.......
|
|
|
|
|
Have you looked at xamarain[^]?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I'm going through a decent EF 4.0 book, and a couple of things came to mind.
I'm used to using LINQ To SQL, in my DAL I have standard CRUD methods, such as:
public void UpdateCompany(CompanyEntity Company)
{
using (var dc = getDataContext())
{
var company = (from c in dc.Companies
where c.CompanyId == Company.Id
select c).First();
if (company != null)
{
company.CompanyName = Company.CompanyName;
company.IsActive = Company.IsActive;
try
{
dc.SubmitChanges();
}
catch (Exception e)
{
throw e;
}
}
}
}
1) If I understand what I'm reading correctly, you wouldn't really do this, as creating a new instance of the data context in each method won't work because of the change tracking in EF. It seems like you would use a single instance of the dataj context. I could use an example of a DAL that works with EF, if anyone has one.
2) Also, in my example I'm using my own entities, which are simple POCO's. Using EF I would use the entities that were generated. But they seem rather heavy compared to POCO's. In a situation where the DAL was accessed via a WCF app, would you use these entities?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
Am no expert here but my general approach is that you create a context in a using block per action you need to perform. For example Adding an Order item to a database create a single context, add the order and order items using that context then commit the changes. This means that if you action has one part that fails then none of it will get committed, and reduces the overhead of creating the context to one per action the user takes not creating one per item that needs adding to the database.
I have also use EF in a service and it performs well enough for my needs, if it speeds up your development and performs well enough then why not use it.
|
|
|
|
|
With EF 4, you can work with straight POCO's. Here's a sample of a simple POCO.
public class Customer
{
public int CustomerID { get; set; }
public string FullName { get; set; }
public DateTime DateOfBirth { get; set; }
} Now, to expose it for others to use
public class MyContext : ObjectContext
{
public MyContext() : base("name="Myentities", "Myentities")
{
Customers = CreateObjectSet<Customer>();
}
public ObjectSet<Customer> Customers { get; private set; }
} And that's it - a basic simple POCO with context and very, very lightweight. If you want to use the POCO over WCF, just change it so that it looks like this:
[DataContract]
public class Customer
{
[Key]
[DataMember]
public int CustomerID { get; set; }
[DataMember]
public string FullName { get; set; }
[DataMember]
public DateTime DateOfBirth { get; set; }
}
|
|
|
|
|
I have a gridview with a buttonfield, and I would like to change the image URL of the field based on a condition of one of the fields. How do I reference the buttonfield?
|
|
|
|
|
Please, start asking ASP.NET questions in the ASP.NET forum. There are so many grid views that have different behaviours depending on what the underlying technology, that it we could quite easily give you the wrong answer.
Also, could you please change your user name? If you don't, you will end up being spammed.
Now, as to your question (and please let this be the last ASP.NET one that you ask in this forum), how you change your button field really depends on how you want to trigger the field change. If it's just based on when you are binding the data to the GridView, there is a RowDataBound event that you can hook into when each row is bound to data. What you would do in this method is find the field you want (here's a crude method):
private void CustomersGridView_RowDataBound(Object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button btnField = (Button)e.Row.FindControl("btnField");
}
}
|
|
|
|