|
of cource, you need to use the dll file inpout32.dll.
[importDll....]
if this is not enough for you, i can send you a code which makes the work.
|
|
|
|
|
I have the dll file...but I can't figure out how to listen to the port..I have void PortAccess(Address)... why is it void??? how to I read than? the output is ok....but I cannt read the port
Samuel
|
|
|
|
|
hmmm, I have the following in the class is it correct
public class PortAccess
{
[DllImport("inpout32.dll", EntryPoint="Out32")]
public static extern void Output(int adress, int value);
[DllImport("inpout32.dll", EntryPoint="Inp32")]
public static extern voidInput(int adress);
}
shouldnt the last line be
public static extern int Input(int adress);
|
|
|
|
|
public class PortAccess
{
[DllImport("inpout32.dll", EntryPoint = "Out32")]
public static extern void Output(int adress, int value);
[DllImport("inpout32.dll", EntryPoint = "Inp32")]
public static extern byte Input(int adress);
} // PortAccess
|
|
|
|
|
|
Hello Friends,
I want to know what is difference between protected and protected internal.
i know that protected means access limited to type and types derived from it.
and protected internal means access limited to type and types derived from it
or in the assembly.
Do protected is subset of protected internal. And do protected is required when
we specify internal as access specifier.
please give example that will be helpfull..
Thanks in advance.
rahul kulkarni
|
|
|
|
|
Rahul.RK wrote: I want to know what is difference between protected and protected internal.
According to the documentation[^] the answer is:
protected = Access is limited to the containing class or types derived from the containing class
protected internal = Access is limited to the current assembly or types derived from the containing class
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
hello Thanks for reply...
i got the concept according to definition.
But as internal gives access to all the assembly then
what is use of protected?
Thats my question..
Rahul Kulkarni
|
|
|
|
|
Rahul.RK wrote: But as internal gives access to all the assembly then what is use of protected?
So you can derive a class from it from outside the assembly.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Thanks alot....
Will you please give me any helpfull site of book name
which will give me idea of all this basic fundamentals of C#.Net
Rahul Kulkarni
|
|
|
|
|
There are lots of beginner books. It really depends on your style of learning. Go to the book store and browse through a few books. Pick the one that appeals to you most.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Thanks for help.
Rahul Kulkarni
|
|
|
|
|
Hello i am facing a slight problem with Store a record in the database.
I have a column of Type Decimal (It can have null values in the DB).
i take the input in a textbox and saves it to the database.
dataRow["SPEED"] = (this.tbSpeed.Text == "" ? DBNull.Value.ToString() : this.tbSpeed.Text);
If I leave it blank it gives me following error
An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dll
Additional information: Input string was not in a correct format.Couldn't store <> in SPEED Column. Expected type is Decimal
What could be the solution to this problem
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
t4urean wrote: DBNull.Value.ToString()
Why are you suppling a ToString() on DBNull.Value ? Don't do that just pass DBNull.Value
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
If I don't use DbNull.value.tostring() then i get the following error
Type of conditional expression cannot be determined because there is no implicit conversion between 'System.DBNull' and 'string'
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
I suspect that is because of the trinary operator that you are using. These are generally considered to be bad practice.
Try this:
if (this.tbSpeed.Text == "")
dataRow["SPEED"] = DBNull.Value;
else
dataRow["SPEED"] = this.tbSpeed.Text;
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
And I'd guess that that the contents of the text box will need to be converted to a decimal also.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Try this:
dataRow["Speed"] = this.tbSpeed.Text ?? (object) DBNull.Value;
|
|
|
|
|
IF you would use a simple "IF", it would be very simple.
|
|
|
|
|
I have used this even then i am getting the same error
if (this.tbSpeed.Text == "")
dataRow["SPEED"] = DBNull.Value;//"NULL";
else
dataRow["SPEED"] = this.tbSpeed.Text;
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
Your manner of storing values in the database seems pretty unusual. I would create a command with an "INSERT" statement as the command text and call it's ExecuteNonQuery() method. For the decimal column I would use an SQL Parameter of decimal type to avoid format errors.
|
|
|
|
|
I have found the solution... Just applied the validation when creating the query string and it works fine to specify NUll for an empty string.
I am doing in the same way you are saying
but i have a seperate class that deals with it when provided with a data row.
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
how can i divide a windows forms in two half horizontally. The upper half contains one listview control and the lower half contains another list view control. and how can i manage the size when the form is expanded making sure that two list view doest overlap each other(i.e when form is expanded);
|
|
|
|
|
You can use a split container. It's in the toolbox. It creates two panels that you can put your controls into with a resizable divider. It ensures that the controls don't overlap. You can set it to be horizonal or vertical.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
is it availabe in dotnet 2003 or frame work 1.1
|
|
|
|