|
Firstable thank you for fast reply.
I just find out that it's impossible to a column in my bigger table is in the second one is a record with the same PK.
Tables looks like this. First one has more then 10 column, but it isn't necessary. I has a primary key so let's call it ID. The second table is much smaller and has additional data. And it has the same primary key column which is foreign key as the same time. I noticed that I cannot modify this column in neither of those tables if it exists in both...
Artur
|
|
|
|
|
The better design would be the following if you can go that way.
Table1
=========
Id - PK
Data1
Data2
...
Table2
=========
Id - PK
Table1Id - FK
AddlData1
AddlData2
...
Thanks,
Ware
|
|
|
|
|
I don't know if I can or should change the database. Next time I'll ask if this ID column will be modify if not there's no problem
Artur
|
|
|
|
|
Hi Guys
How to set a description for a property in a class? I have found some articiles talking about method description using summary tag. summary.../summary. But it doesn't seem to be working for properties.
Can any one help me on this?
Thanks in advance.
Muthu.
|
|
|
|
|
Muthu
You do use the summary tag. This is an example:
public int Id
{
get { return _id ; }
set { _id = value; }
}
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'm sorry. I didn't mention that it is for intellisense description.
I tried both ///summary and System.ComponentModel
I didn't get intellisense description in both cases.
Thanks
Muthu.
|
|
|
|
|
The properties shown by Visual Designer are not from the /// tags, but from
the Description attribute, which is unfortunate, since this makes me write
the same thing twice, as in:
using System.ComponentModel; // Category, Description
/// <summary>
/// Gets or sets the initial color of the overlay.
/// Use Color.Transparent to make it always transparent, or
/// some opaque color to get the scratch functionality.
/// </summary>
[Category("ScratchPanel"), Description("Gets of sets the initial color of the overlay. "+
"Use Color.Transparent to make it always transparent, or "+
"some opaque color to get the scratch functionality.")]
public override Color ForeColor {
...
}
Luc Pattyn
|
|
|
|
|
I'm sorry. I didn't mention that it is for intellisense description.
I tried both ///summary and System.ComponentModel
I didn't get intellisense description in both cases.
Thanks
Muthu.
|
|
|
|
|
Yes you are right, there is an issue. I havent noticed this before:
Visual Studio 7.1 does not show Intellisense for properties (it does for methods e.a.),
but Visual Studio 8.0 does !
Luc Pattyn
|
|
|
|
|
public void abcMethod1()
{
string cspurl = @"http://xyz.aspx";
bool expected = true;
bool actual;
actual = @"http://xyz.aspx";
Assert.AreEqual(expected, actual, "");
}
Here actual Value means, what could i assign for actual variable as am getting mismatch error, as i assigned string value to bool variable.
|
|
|
|
|
Why are you testing a string value to a bool?
Don't you mean:
Assert.IsTrue(cspurl==actual, "Check string equality");
|
|
|
|
|
even then am getting an error, "Operator '==' cannot be applied to operands of type 'bool' and 'string'", if i use the
Assert.IsTrue(cspurl==actual,"Check string equality");
|
|
|
|
|
you declared actual as a bool. Declare it as a string.
|
|
|
|
|
public void abcMethod1()
{
string expected = @"http://xyz.aspx";
string actual = ...;
Assert.AreSame(expected, actual);
}
|
|
|
|
|
I probably don't understand this, but from when we can assign string values to bool (which is always true or false) data value type ?!
If you need compare two strings (use string's .Equals function) :
string ww1 = @"http://xyz.aspx";
string ww2 = @"http://xyz.aspx";
if (ww1.Equals(ww2))
{
// oh yes
}
VirtualVoid.NET
|
|
|
|
|
I have 2 List<string> objects A and B.
I would like to compare A against B and get the following information:
Which elements are only contained in A?
Which elements are only contained in B?
Is there a standard algorithm for this?
Thanks,
Kathy.
|
|
|
|
|
One way is to first sort the lists, then you can easily loop through them side by side and compare them.
Pseudo code:
sort A
sort B
loop {
get a from A
get b from B
if a < b
"Only in A: " + a
advance A
else if b < a
"Only in B: " + b
advance B
else
advance A
advance B
}
You have to keep track of when the lists end, also. I did not include that in the pseudo code, for simplicity.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks.
I should also mention that the lists could be different lengths.
Kathy.
|
|
|
|
|
KatNel wrote: I should also mention that the lists could be different lengths.
I took for granted that they could be, as you want the items that are present in only one of the lists.
---
single minded; short sighted; long gone;
|
|
|
|
|
here's my final:
private void diff2()
{
List<string> aList = new List<string>();
aList.Add("a");
aList.Add("d");
List<string> bList = new List<string>();
bList.Add("z");
bList.Add("a");
CompareLists(aList, bList,
delegate(string a) { Console.WriteLine(a + " only in list a"); },
delegate(string b) { Console.WriteLine(b + " only in list b"); },
delegate(string c) { Console.WriteLine(c + " in both"); }
);
}
delegate void InList(string inputValue);
private void CompareLists(List<string> al, List<string> bl, InList onlyA, InList onlyB, InList both)
{
int a = 0;
int b = 0;
al.Sort();
bl.Sort();
while ((a < al.Count) && (b < bl.Count))
{
int cp = al[a].CompareTo(bl[b]);
if (cp < 0)
onlyA(al[a++]);
else if (cp > 0)
onlyB(bl[b++]);
else
{
++a;
both(bl[b++]);
}
}
while (a < al.Count)
onlyA(al[a++]);
while (b < bl.Count)
onlyB(bl[b++]);
}
|
|
|
|
|
Below a quite different approach in pseudocode:
Collection common=new Collection();
foreach(object i in a.Clone()) {
if (b.Contains(i)) {
a.Remove(i);
b.Remove(i);
common.Add(i);
}
}
At the end, you have three collections: common holds the common items,
a and b only keep the non-common items.
a.Clone is necessary since we want to modify a while enumerating.
Luc Pattyn
|
|
|
|
|
I was trying to schedule the computer to go into standby / hibernate mode. After a specified duration I wanted the PC to come out of standby. I wanted to automatically send my computer to standby between specific times of the day.
Its easy enough to send the computer into standby, how do you bring it out?
Does anyone know how to accomplish this?
Thanks in advance.
|
|
|
|
|
I would like to know how can i move with IEnumerator movenext and moveback, that is forward and back in the list iterated.
|
|
|
|
|
IEnumerator only supports moving in a logically forward direction. Further, the Reset() method is optional and may not be supported by all instances of IEnumerator .
/ravi
|
|
|
|
|
Hey
Does anyone have an idea to implent something like paint? I need to create a program like Pictionary or iSketch.net but I have no idea to implement the drawing area.
Greetings
K.
|
|
|
|