|
|
The SQL instance names are different on each PC, so I have different connection strings
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
That's what I use it for: different connections strings for my Desktop and the WookieTab. Change in one place on each machine (when necessary, I did it when I changed the PC name for the desktop and found out how many different little apps I had accessing SQL the hard way) and it changes in all apps on that machine.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
If it's SQL server on your home machine, you can set up an alias so that when it sees the instance name used at work, it actually points to your local instance. You can therefore use the same connection string on both machines.
You set this up using SQL configuration manager
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Environement.MachineName tells me "who" is running ... and I can build my connections strings (db; web server; web services) accordingly.
If it's one of my "development machines", the app will run in "developer mode" (when activated).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
hi, i'm rezki from Indonesia, i was a student at a university in Indonesia..
i use emgu cv to make a SURF program to image retrieval, and i have a list code like this :
Index fln = new Index(supermatrix, 4);
but then, it gives me an error like this :
Argument 2 : cannot convert from 'int' to 'Emgu.CV,Flann.IIndexparams
can you help me please..
i'm so stressfull to solving this error :'(
thank you so much.. and i'm sorry to take your time 
|
|
|
|
|
The Index constructor does not take a simple integer values for the second parameter. See Index Constructor[^] for details.
|
|
|
|
|
|
It's telling you that you can't pass an integer in; instead, you have to pass in something that implements IIndexParams. The default implementations from Emgu are AutotunedIndexParams, CompositeIndexParams, HierarchicalClusteringIndexParams, KdTreeIndexParams, KMeansIndexParams, LinearIndexParams, LshIndexParams and SearchParams. You just need to choose the appropriate one (also, you need to learn how to read a build error; this was all clearly laid out).
This space for rent
|
|
|
|
|
Pete O'Hanlon wrote: also, you need to learn how to read a build error; this was all clearly laid out
Yes, but I remember in this galaxy long, long ago, when I was still a padawan, I also had trouble reading those d*mn build errors.
With time, one learns to understand the force and read build errors.
|
|
|
|
|
Hi, thank you so much for your solution 😄..
I will do that sir,thank you..
|
|
|
|
|
how 3tier application works.......??
|
|
|
|
|
|
You forgot the "presentation layer" (PAL?).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
yeah..!! Plz explain tat also..
|
|
|
|
|
I have 3 tables:
Companies
Company Contacts
Contacts
For a given company Id I want to pull all contacts:
var contacts = db.Contacts.Where(c => db.CompanyContacts
.Select(cc => cc.CompanyId)
.Contains(c.Id)).
Select(x => new ContactEntity
{
Id = x.Id,
Prefix = x.Prefix,
FirstName = x.FirstName,
MiddleName = x.MiddleName,
LastName = x.LastName,
Suffix = x.Sufffix
});
This is returning ALL contacts, not just the contacts for the companyId passed in.
What's the right way to do this?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
You need to set the variable value of the company ID to your where clause. Here's a quick example using syntax-based query.
var companyId = 100;
var contacts = (from a in db.Company
join b in db.CompanyContacts on a.CompanyId equals b.CompanyId
join c in db.Contacts on b.ContactId equals c.ContactId
where a.CompanyId == companyId
select(x => new ContactEntity
{
Id = x.Id,
Prefix = x.Prefix,
FirstName = x.FirstName,
MiddleName = x.MiddleName,
LastName = x.LastName,
Suffix = x.Sufffix
}));
modified 4-Jan-18 2:05am.
|
|
|
|
|
Hi everybody,
I have an image which displays the state of execution of an action.
- green: the execution is currently performed
- yellow: the execution has been interrupted
- red: an error has occurred
- green: the execution is complete and went fine.
The problem:
I would like to make this image blinking (green) as long as the current action is executed.
Has anyone an idea on how to proceed?
|
|
|
|
|
Sounds like an ideal candidate to run as an animation[^].
This space for rent
|
|
|
|
|
I'd vote against any animation; seen lots of animations continue where the current action was definitely not executing.
Assuming you're doing the "current action" in a background-thread, you would want to "ReportProgress" as the backgroundworker does. On each reportprogress, toggle the green image to its next state. That way if your "current action" dies then it will be reflected in the green light no longer blinking.
Yes, may sound like a lot more work than an animation, but then again, this way it also adds something usefull, instead of an animation that merely gives the impression that something might be going on. One is adding value, the other is wasting money.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Just did something similar for a "warning" system. The word "Warning" will alternate black on white / white on red in a "topmost" window (along with problem details).
While you could use a StoryBoard, I used a DispatcherTimer instead to alternate the forground and background colors of the "warning word", thus creating the "blinking". (500 ms seems annoying enough).
private void Window_Loaded( object sender, RoutedEventArgs e ) {
_blinkTimer = new DispatcherTimer();
_blinkTimer.Tick += timer_Tick;
_blinkTimer.Interval = new TimeSpan( 0, 0, 0, 0, 500 );
_blinkTimer.Start();
}
private void timer_Tick( object sender, EventArgs e ) {
if ( _blinkToggle ) {
uxWarningText.Foreground = Brushes.Black;
uxWarningText.Background = Brushes.White;
} else {
if ( this.ZoneWarnings.Count > 0 ) {
uxWarningText.Foreground = Brushes.White;
uxWarningText.Background = Brushes.Red;
}
}
_blinkToggle = !_blinkToggle;
}
For images, you can put them all in the same Grid cell, and then just toggle their visibilities based on what should show when.
(But, yes, don't "blink" unless you have to; I mostly rely on status "colors" and Segoe UI Symbol icons.)
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
modified 3-Jan-18 12:22pm.
|
|
|
|
|
If I have an object defined in a method and pass that object into another method, perform some operation that changes a parameter value in that object and then pass the same object back to the caller, is that the same as using ref or out?
Inside some method:
SomeObj myobj = new SomeObj ( someparam = "Some Value" );
myobj = DoSomething( myobj );
And then the method:
private SomeObj DoSomething( SomeObj myobj )
{
myobj.someparam = "Some New Value";
return myobj;
}
I'm trying to wrap my head around this in C#. I'm not sure if there are any pitfalls to doing it this way.
|
|
|
|
|
For a question such as this, I'd recommend reading this[^] from Jon Skeet (a guru of the C# world).
This space for rent
|
|
|
|
|
Great article. Thank you!
|
|
|
|
|
That way has an advantage, and it's pretty major - you can chain things:
DoSomething(myobj).DoSomethingElse(); But it's often nicer to see it the otehr way round:
myObj.DoSomething().DoSomethingElse(); For example, if I want today's date (without the time), but one year and one day in the future:
DateTime expiry = DateTime.Now.Date.AddYears(1).AddDays(1); If they didn't return values then it gets messy to work out what is happening:
DateTime expiry = DateTime.Now;
expiry.Date(out expiry);
expiry.AddYears(1, out expiry);
expiry.AddDays(1, out expiry);
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|