|
List<T> could be employed here (such as List<Asset>).
AddRange won't work in this case however, as it is not an ICollection that is being added. So, while:
result.AddRange(assets.Rows);
would work (if Rows was to be returned), this line:
result.AddRange(new Asset(dr));
would not. (Did you miss that Asset was a class constructor with the row as a parameter?) The returning value in this case is a collection of Asset objects (I have not defined the Asset class here, I just provided the snippet as an example of MS Access interaction).
|
|
|
|
|
I had missed that .
It would require .NET 3.5 and linq to use
Rows.OfType<T>() or similar
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Your book using SQL Server examples should give you enough to get things working. In the .Net Framework, the System.Data namespace are classes for several types of provider, and the syntax for each is nearly identical. For a connection, SQL Server needs SqlConnection, for MS Access you use OleDbConnection. Similarly, while SQL Server uses SqlCommand, Access uses OleDbCommand. The slight differences, if any, in the arguments each method requires can be resolved with the clues given by IntelliSense, or simply using Help in Visual Studio. Try searching Help for 'System.Data.OleDb' and see what classes are revealed.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
when i wanna to connect to sql i get this problem.
My server sql info :
Microsoft sql server 2008 (RTM) - 10.0.1600.22 (interl X86) (build 6002: service Pack 2)
and my system SQL info :
<code>Microsoft sql server 2005 (RTM) - 9.00.1399.06 (interl X86) (build 2600: service Pack 2)</code>
I get this Error :
<code>This version of microsoft sql server management studio can only be used to connect to sql server 2000 and sql server 2005 servers.(ConnectionDlg).</code>
|
|
|
|
|
Go to the Visual Studio Express page at Microsoft.com and download the Management Studio 2008 package. Your existing MS installation can't communicate with the newer SQL Server 2008 system.
( I ran into the same problem, briefly )
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Thanks for ans .
can you please give me the address ?
how much is its size(MB)?
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:53am.
|
|
|
|
|
I am downloading SQL sp3 .
will it help me?
|
|
|
|
|
|
i am downloading sql 2005 sp3.
will it help me?
|
|
|
|
|
No.
You're trying to connect to a SQL Server 2008 instance, and SQL Server 2005 is a whole different animal. Is there a reason that you have to keep SQL Server 2005? If not, I'd recommend that you install the 2008 version everywhere to maintain compatibility. I found that I was unable to install SQL Server 2008 on any machine that has the 2005 version installed - apparently they don't play well together.
If you have no real need to keep SQL Server 2005, I'd uninstall it and install the 2008 version in its place. Be advised, though, that the uninstall doesn't always work well. I had so much trouble with that, I had to install all the new parts on another computer, then access them through the network. I hope it works better for you...
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
I am going to implement a "Select render quality" (high or low)feature into my xna game. A form of achieving this could be:
.... loadingcontent()
if Render is high then
texture = Content.Load<texture2d>("myhighresversion")
else
texture = Content.Load<texture2d>("mylowresversion")
end if
...end loading content()
This way of doin it seems tedious and not very OOP, does any one know a better way of doing this before i result to highschool code full of if statements! :P
Thanks.
|
|
|
|
|
There would actually be only one IF statement
if Render is HIGH
{
load all highres textures
}
else
{
load all lowres textures
}
Another way that occured to me is saving your (hi/low)res versions of textures in separate folders and then do something like
string dir = Render is high ? "high" : "low";
texture = Content.Load<Texture2D>(dir + "/mytexture");
... etc.
Honza
|
|
|
|
|
Thanks the second option seems better
|
|
|
|
|
Hi All,
Is it possible to calculate pixel intensity in Candela using RGB values?
Thanks,
Shrini
|
|
|
|
|
Not accurately. Since Candela is a measure of blackbody radiation (or actual light emitted if you like), it is going to depend on the monitor and monitor settings. Wind the Brightness up, N + x candela. Alter the Contrast, N +/- y candela depending on colour.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Hi,
Thanks for reply.
I'm writing in detail what I want to do.
I'm taking image of the object. The object has a portion which glows and image is captured. I want to measure the intensity of that portion in candela. Is there any way to do it?
Thanks,
Shrini
|
|
|
|
|
For the reasons I explained, candela is not really available. However, if it is a relative brightness you are after, (i.e. find-the-bright-bit of teh picture, rather than find-the-17-candela-bit) then the Color class can return the HSB/HLS brightness value for an RGB value, using Color.GetBrightness[^]
What you would have to do would be to get each individual pixel and check it's colour value as a brightness. This would probably be rather slow if you do it via GetPixel, however. You may want to start with GetPixel and then move to using BitmapData via an unsafe pointer to speed it up.
You can also replace the GetBrightness with your own routine, calculating the HLS Brightness yourself. If I remember correctly (and I could be wrong, it's been a LONG time since I used any of this) it is not that difficult - wiki can help here[^]
What are you using this for?
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
I'm doing a project in which I'm taking picture of control panel using Cannon camera. The picture taken will be compared with standard picture for differences i.e. anything is missing out on control panel or not. There are some glowing portions, I want to calculate the intensity that portion. I can able to calculate the pixel intensity using RGB values but the requirement is to calculate it in Candela.
|
|
|
|
|
The only way you are going to be able to do that is to calibrate the particular camera you are using (at a fixed distance) with a series of known emmisions.
Get a few sources and measure them. You should then be able to work out the candela-to-brightness relationship and extrapolate intermediate values.
If your camera is changed, or moved relative to the panel, this would need to be done again.
If this is for production test / QA, then you are probably better off using panels with known "good" and "bad" displays, and setting a rejection threshold that way.
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
Are you making this more complicated than it needs to be?
Member 3332228 wrote: The picture taken will be compared with standard picture for differences i.e. anything is missing out on control panel or not.
It would seem to me that you don't need to calculate intensity, or absolute brightness level, to do this; you really only need to be able to find the differences between the reference image and the current image and make decisions based on those differences.
I'm not sure how measuring an absolute intensity helps you.
Days spent at sea are not deducted from one's alloted span - Phoenician proverb
|
|
|
|
|
Hi
I am trying to call VLC libvlc function. In there, one function returned linked list structure . How can get this structure in C#.
This is C++ code of libVlc.dll
typedef struct libvlc_audio_output_t
{
char *psz_name;
char *psz_description;
struct libvlc_audio_output_t *p_next;
} libvlc_audio_output_t;
I am trying like these..
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct LocaleInfo
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
public string countryName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
public string localeName;
public IntPtr next;
};
when i was call these function fron c# . i get "Method's type signature is not PInvoke compatible." Exception ....
How can handle these . please share if you have any idea
Thanks
|
|
|
|
|
anishkannan wrote: Method's type signature is not PInvoke compatible
Considering the exception said the method's signature isn't compatible, what does the C++ and your corresponding C# method signature look like?
I'm no expert in interop so I could be totally wrong, but here's a suggestion. If I'm wrong, someone please correct me, I'd like to make sure of this myself. Let's say your C++ method is
libvlc_audio_output_t some_function() and your C# version is
[DllImport("your_library.dll", EntryPoint="some_function")]
LocalInfo some_function(); I would guess the problem is the return type (see the response in this post[^]). Try returning an IntPtr instead, and using Marshal.PtrToStructure() to convert to your LocalInfo structure.
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
You are getting an error when calling a function, but you haven't shown the C/C++ prototype from the header file or your C# declaration of this function.
As far as the struct goes, try passing StringBuilder s for the first two parameters that are initialized with a suitable capacity.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Okay, I'm still fairly new to the whole c# coding world so please don't beat me up too bad.
I was wondering if someone could shed some light on me with how I would go about doing the following..
I have a database setup to keep track of my books and I wanted to make a treeview to list the authors and then each book that I have by that author. Well lets say I have 4 books for the example
Database consist of ID, Author, Title
row 1 : 1, Tony Stegall, First book
row 2 : 2, Joe Smith, Joe Says Hi
row 3 : 3, Tony Stegall, Second book
row 4 : 4, Jim Smith, Jim has a friend named Joe
How in the heck can i get it to print out something like this
Smith,Jim
- Jim has a friend named Joe
Smith,Joe
- Joe Says Hi
Stegall, Tony
- First Book
- Second Book
Would I have to run a filter on each authorname? Or is there some other way to do this? Just trying to learn this stuff but not really sure how to go about it. I pretty much understand the whole treeview add a parent then add a child deal but I'm not sure how to get the childs to be placed under the unique parent...
Thanks for your help.
|
|
|
|