|
That is a soft number, the doc says "This function returns the volume serial number that the operating system assigns when a hard disk is formatted." Not the real stuff.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
You're right
I just saw the keywords "volume" and "serial" and didn't stop to read the question.
Kafein
|
|
|
|
|
Hi,
there are two serial numbers:
- a soft one, created by Windows when formatting a partition; that's what GetVolumeInformation would return.
- a hard one, set by the manufacturer, and read-only afterwards. There are a couple of ways to get it, one through WMI, one through direct device I/O with CreateFile and ReadFile; both of these require admin with elevation under Vista (and probably all future Windows versions).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
What would you do with it? Most things involving getting hardware serial numbers are pure evil..
|
|
|
|
|
I have written an application where a user can select some parameters using a windows form. The app grabs data from various tables and amalgamates them into a single table. I have also created a dataset with the same columns as the amalgamated table. I created a new crystal report and added the table in the dataset as its datasource. I dragged the columns onto the report.
At runtime, I fill the table, then set the report's datasource to the amalgamated table like below:
EmployeeReport rpt = new EmployeeReport();// This is the crystal report
rpt.Database.Tables(0).SetDataSource(data); // data is the amalgamated table filled at runtime
Then I set the CrystalReportViewer control's source as below
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.ReportSource = rpt;
However, none of the fields are shown in the report except for the layout which I created at design time using boxes and labels etc.
I have been searching and googling but no luck
CodingYoshi
Artificial Intelligence is no match for Human Stupidity.
|
|
|
|
|
I don't believe it! No one here has an answer! Come on I need some help!
CodingYoshi
Artificial Intelligence is no match for Human Stupidity.
|
|
|
|
|
are you saying that the fields you dragged onto the report aren't showing at runtime?
Have you done a viewer.DataBind(); after setting the reportsource?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
viewer.DataBind() is not an available method on CrystalReportViewer control. This is a desktop application, not a web application. Basically what I am trying to do is as following, for example:
I have created the layout of the form for customer orders. Each order should be on a separate page but the layout will be consistent. I grab the data using many stored procedures and then put them into one table (TableAll for example). I have also created one dataset with one table (TableDataSet for example), at design time, which has exactly the same structure as TableAll. I set the crystal report's datasource to the TableDataSet by using Database Expert (Right click the Database field). I drag the fields from the Database fields onto my report.
At run time, my app populate DataAll and I set the report's table (TableDataSet) source to DataAll as below:
OrderReport report = new OrderReport(); // Crystal report
// The first table of the report gets its data from DataAll, they have same structure
report.Database.Tables(0).SetDataSource(DataAll);
// Create the viewer
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.ReportSource = report;
viewer.Visible = true;
The report however only contains the layout but no data. Why do you think?
CodingYoshi
Artificial Intelligence is no match for Human Stupidity.
|
|
|
|
|
when I googled I found that 'var' in .Net is used if .NETFramework3.0 is there, IS there any variant datatype in c# for using in vs2005 in similar way.
|
|
|
|
|
var in 3.5 practically means "Deduce the variable type at compile-time", so, for converting code to 2.0 you have to substitute var with the right type for all variables.
For example,
3.5
var i = 0;
var s = "Hello"; in 2.0 becomes
int i = 0;
string s = "Hello";
|
|
|
|
|
Var was added for Linq.
You must be abusing var , don't. Just use the type.
|
|
|
|
|
var is a language feature introduced in .NET so that C# can follow in the popularity of VB6.
object would be the closest charlie foxtrot counterpart available in 2.0.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: object would be the closest charlie foxtrot counterpart available in 2.0.
It will take quite a twist to make this work:
object a=1;
object b=2;
object c=a+b;
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Closest counterpart does not imply identical functionality. Personally I am completely opposed to the var construct.
|
|
|
|
|
Right. I haven't used var (nor LINQ), and I don't intend to.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I guess that makes three of us.
|
|
|
|
|
I like "var", but you have to know where to use it... Used properly, it makes the code nicer to read... Used improperly, you're hammering nails into the heads of whoever has to maintain your code later on.
Good:
// You know exactly what type customerMap is, because it's right there.
var customerMap = new Dictionary<string, List<CustomerBusinessObject>>();
Bad:
// You have to dig into another function to figure out what type it is
var customerMap = mapGenerator.GetCustomerMap();
(Yes, it's a bad example, because Dictionary<string, ...>> should be defined as a class for readability, but you get the point)
|
|
|
|
|
No, it is only to be used when you can't know the type; it's not to be used simply as a crutch for lazy programmers.
|
|
|
|
|
Laziness has nothing to do with it. I know it was originally designed for linq queries (For which I usually do a ToArray() and strongly type it), but it can also make more readable code by getting rid of some of the redundancy.
Sure, I could type a long type definition twice, or copy-paste it, but it looks a lot cleaner if you only specify the type once.
|
|
|
|
|
Even though you may not be lazy, many are.
|
|
|
|
|
PIEBALDconsult wrote: it is only to be used when you can't know the type;
Not trying to start an argument here, just curious. Would you say all dynamic languages are hard to read and are only for lazy programmers?
Python, which many people proclaim as the language easiest to read and understand, doesn't let you specify types for variables. There is no keyword equivalent to var even.
Also, I'd think var is useful when you don't care about the actual type, only that it has certain methods or properties.
var result = CalculateSomething();
result.DoX();
The code expresses the intent that it doesn't care what type result is, as long as there is a DoX method on it (without which it won't compile, of course). In a way, it's almost like result is a generic or template parameter.
What do you think?
|
|
|
|
|
I don't know Python, and I guess I don't want to.
C# 4.0 has dynamic, but I've only seen a small demo of it, so I really can't say. I expect it will be abused as well.
|
|
|
|
|
Luc Pattyn wrote: Right. I haven't used var
Me too. But, I use the auto (equivalent for var introduced in C++0x) keyword extensively in C++ and it makes the code more readable.
|
|
|
|
|
Hi all,
Please help me with your ideas
From c#.net application how to perform scan operation using twain protocol?
thanks
|
|
|
|
|
The first result[^] of a google search[^], finds one on this very site. I'm sure many of the other 257000 results may prove fruitful too.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|