| Wrong Byte order when writing with a binary writer |
|
 |
Index ‹ DotNet ‹ Net Framework
|
- Previous
- 1
- ADO >> Extra DataColumn's in DataTableHave a strange problem using a sproc to populate a DataTable.
The sproc itself is fairly simple and returns a selection of columns from
three tables, a master table and two additional tables which are joined via
a LEFT JOIN.
The resultant DataTable schema after a fillschema looks good however after
a 'fill' the DataTable has two extra columns at the end which represent the
unselected columns from the two LEFT JOIN tables. These columns do not form
part of the SELECT statement yet are appearing in the DataTable with all
values set to null.
I have tried the same query with a DataReader and see the correct columns
(obviously executing the same sproc from query analyser shows the correct
column set) therefore it appears to be a DataAdaptor issue which is somehow
pulling down these unselected columns. This problem is a right pain as the
I am binding a DataGrid to the DataTable via a DataView and the extra
columns appear at the end of the grid.
I know I could remove the columns via TableStyles however I might change
the database schema at some point and I would need to know dynamically at
run-time which columns were garbage and at the moment I can't see any
properies on these columns which I could process against.
This looks like a bug to me therefore interested if anyone has come across.
Can post sample code (c#) and sproc if anyone would like to see.
Regards
Paul
- 2
- ADO >> SqlDataAdapter and DataSetWhen you call Fill method passing a DataSet object and table name, is that
table name associated with the SQL Server table name or just the moniker
that will be attached to the generated table inside thee DataSet's
TableCollection? What if you call Fill() without passing a table name, does
SqlDataAdapter generate some name?
- 3
- Winforms >> No Touch Deployment Error QuestionHI,
I am getting this error when I try to create a new instance of one of my
forms.
--
System.Security.SecurityException: Security error.
--
This error is thrown in the CTOR on the MyBase.New() call.
At this stage I have already created and displayed several other forms right
before this step, so it doesn't make sense why this particular form would
fail it is just a Standard windows form, with Menus/toolbars on it. It
doesn't even tell my what kind of security error
TIA,
--
Paul
- 4
- 5
- Visual C#.Net >> MSMQ triggerApart from designing a timer to examine the queue, I know
that the new version of MSMQ over XP/2003 platform
provides a way called 'MSMQ trigger', anyone had some
experience of using it from programmer's point of view?
thanks in advance
- 6
- Visual C#.Net >> linking to enumeration members in xml commentsi often see in MSDN and third party component providers link to enum
members in their docs. but if i try to do something like <see
cref="MyEnum.Member1"/> i always get an error from the compiler, that
the member doesn't exist or something. how can i link to members of an
enumeration, like i link to methods in other classes?
- 7
- Net Framework >> Updating a windows forms control from a threadI've gotten this question a couple of times in interviews and I don't know
what they are looking for:
How do you update a control's property, such as a textbox.text property,
from a thread, in .NET? It seems to me you just update it normally. What
are the interviewers looking for here? Thanks.
- W
- 8
- Dotnet >> Smart Client DeploymentI am trying to deploy my Smart Client (it accesses a Web Service) on to a server.It works fine in my machine and also works when others access it from my machine.
But when deployed to another server it does not run and opens the debugger.I tried with Full trust yet it does not work.
Please help me out.
- 9
- Visual C#.Net >> Conservar estado control personalizadoHola a todos:
Estoy intentando hacer un control y necesito mantener el
estado de la siguiente colección que he creado:
public struct ColumnaGrid
{
public string TituloCabecera;
public int LongitudCabecera;
.........
}
[Serializable()]
public class ColeccionColumnasGrid:System.Collections.CollectionBase
{
public ColumnaGrid Item(int indice)
{
return (ColumnaGrid) List[indice];
}
public void Add(ColumnaGrid objColumnaGrid)
{
List.Add(objColumnaGrid);
}
.......}
La estoy intentando guardar en el viewstate pero no hay
forma, uso lo siguiente.
public ColeccionColumnasGrid ColumnasGrid
{
get
{
ColeccionColumnasGrid columnasGrid;
columnasGrid=(ColeccionColumnasGrid) ViewState ["columnasGrid"];
return columnasGrid;
}
set
{
ViewState["columnasGrid"]=value;
}
}
He leido algo de que hay que serializarla pero no se como
hacerlo.
A ver si alguien me puede echar una manita.
Muchas gracias.
.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
- 10
- Winforms >> Problem with forms not properly disposedTo be able to explain what's happening, I will use a short example:
The example is created in VB.Net 1.1.
I have a form with a combobox on it. The datasource is set to a global
datatable object which is instanciated on a vb module.
I instanciate the form, set the datasource, valuemember and displaymember on
the combobox. Then i dispose the form. After the form is disposed and I do
any changes to the global datatable (e.g. clear all rows), the
SelectedIndexChanged event on the combobox is still triggered.
How is that possible?
Any help would be appreciated.
Regards, Rolf F.
- 11
- Winforms >> New to WindowsFormsHi I am learning windows fomrs and started with the sample in the quickstart
tutorials and I am not able to display the control on my aspx page.
I created a control library with one simple control having a panel and a
button. panel's visible property is false by default and I added color to
panel.
On the button press event , I set the visible property of the panel to true
to show the panel.
This control is created as test1.dll and then added to a web application and
added to aspx page as an object and calling with the classid property to
display the control. I have also set the objects property "VIEWASTEXT' .
The problem is that the aspx page does show the placeholder but does nto
display the control.
what am I doing wrong?
Please advice.
thanks
sam
- 12
- ADO >> Tablemappings and join?Hi,
I have this sql command:
Select recommendation, timescale from audits, auditItems where
AuditItems.ParentAuditID = Audts.AuditID and Audits.SupplierId = '" &
ComboItem.Value & "'"
So what do i set tablemappings to?
I usually do this:
myDataAdapter.TableMappings.Add("Table", "Audititems")
but that doesnt work... Any ideas?
Thanks,
Dan
- 13
- 14
- Winforms >> Click Event HandlerI have a C# .net 2003 program that has a processing loop in a click event
handler for one of the form's controls. The loop has a DoEvents
and a Thread.Sleep for each iteration to simulate a lengthy process. I want
to be able to have the user click a cancel button to set a flag to stop the
looping but I have found that the first click on another control while in
the click event of the first control is not caught by the program. Sometimes
takes many clicks to work at all. Does anyone know what is happening here ?
- 15
- Visual C#.Net >> Cannot call Invoke or InvokeAsync on a control until the window handle has been createdHi
I am having this InvalidOperationException with message Cannot call Invoke
or InvokeAsync on a control until the window handle has been created
This is raised when i try to invoke a method with arguments
I need to do this as the method is being called Asynchronously from
elsewhere using delegate's BeginInvoke method.
The form is well created/initialized yet the messages states otherwise.
Cant extract a sample code out of my app.
Let me know if the code is needed for the problem.
All controls on the form are in a panel. The form itself isnt show, but the
panel is shown as a child control of some other panel. Can this be the
problem.
Thank you
rawCoder
|
| Author |
Message |
ToddBailey

|
Posted: Thu Sep 11 00:29:29 CDT 2003 |
Top |
Net Framework >> Wrong Byte order when writing with a binary writer
Hi!
I have the following problem:
I want to write an integer value (e.g. 14) with a binarywriter.
The written file contains the following entry:
0E 00 00 00
I want the entry to be the following:
00 00 00 0E
Does anybody know how to get the desired result (Language vb)?
Thanks in advance,
Marko
DotNet314
|
| |
|
| |
 |
William

|
Posted: Thu Sep 11 00:29:29 CDT 2003 |
Top |
Net Framework >> Wrong Byte order when writing with a binary writer
Check out IPAddress.NetworkToHostOrder and hosttonetworkorder to change
endian-ness.
--
William Stacey, DNS MVP
"Marko Maehner" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> Hi!
>
> I have the following problem:
>
> I want to write an integer value (e.g. 14) with a binarywriter.
>
> The written file contains the following entry:
> 0E 00 00 00
>
> I want the entry to be the following:
> 00 00 00 0E
>
> Does anybody know how to get the desired result (Language vb)?
>
> Thanks in advance,
> Marko
|
| |
|
| |
 |
Magnus

|
Posted: Thu Sep 11 01:20:51 CDT 2003 |
Top |
Net Framework >> Wrong Byte order when writing with a binary writer
The byte order is not wrong since Windows is big-endian. If you need to
control the byte order you can stream it byte per byte yourself. That way
you can store integers in litte-endian instead. But why? If you use a binary
reader to read integers you will receive the same value as stored with the
binary writer. I can see the problem if you write data on a big-endian
system and read the data on a little-endian system but that can all be
solved by adding a header containing information about the "endianess".
/M
"Marko Maehner" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> Hi!
>
> I have the following problem:
>
> I want to write an integer value (e.g. 14) with a binarywriter.
>
> The written file contains the following entry:
> 0E 00 00 00
>
> I want the entry to be the following:
> 00 00 00 0E
>
> Does anybody know how to get the desired result (Language vb)?
>
> Thanks in advance,
> Marko
|
| |
|
| |
 |
Daniel

|
Posted: Thu Sep 11 02:25:33 CDT 2003 |
Top |
Net Framework >> Wrong Byte order when writing with a binary writer
"Magnus Persson" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> The byte order is not wrong since Windows is big-endian. If you need to
> control the byte order you can stream it byte per byte yourself. That way
> you can store integers in litte-endian instead. But why? If you use a
binary
> reader to read integers you will receive the same value as stored with the
> binary writer. I can see the problem if you write data on a big-endian
> system and read the data on a little-endian system but that can all be
> solved by adding a header containing information about the "endianess".
>
If, of course, you have any say in the format. Pretty possible thats been
determined by parties well outside of the OP.
Also, Intel chips are little endian and Windows and native programs, by
extension, usually use use little endian integers nativly. The .NET CLR is
big endian as I recall, which is frustrating at times for binary
interopability with legacy native code. I assume that the JIT'er handles the
endian conversions for code execution, but that doesn't help with writing
binary data.
On other processors, the endian'ness (is there a proper term for this?) can
change. Assuming you get rotor or mono to work on the mac, you are on a
processor that, I think, can be either. However, I believe Mac OS uses
big-endian and native code would for that platform is more likely expect big
endian integers. I'm not sure on all these points, someone correct me if I'm
mistaken please.
Its something we all have to be used to sometimes...
> /M
>
> "Marko Maehner" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> > Hi!
> >
> > I have the following problem:
> >
> > I want to write an integer value (e.g. 14) with a binarywriter.
> >
> > The written file contains the following entry:
> > 0E 00 00 00
> >
> > I want the entry to be the following:
> > 00 00 00 0E
> >
> > Does anybody know how to get the desired result (Language vb)?
> >
> > Thanks in advance,
> > Marko
>
>
|
| |
|
| |
 |
marko

|
Posted: Thu Sep 11 03:19:39 CDT 2003 |
Top |
Net Framework >> Wrong Byte order when writing with a binary writer
Further information: The written binary file will be sent to another
system (little endian), so it doesn't help to be able to read the data
with an binary reader.
|
| |
|
| |
 |
Magnus

|
Posted: Mon Sep 15 01:58:41 CDT 2003 |
Top |
Net Framework >> Wrong Byte order when writing with a binary writer
Oops, I did mixup the big/little endian stuff.
Intel chips are little-endian and when running Windows 9x/Me/NT/2k/XP on
intel chips the OS will also be little-endian.
I did develop programs for BeOS some time ago (was also a beta tester for
both version 4 and version 5 of BeOS) and since that OS run on PowerPC
(which is bi-endian) there were APIs to determin if the system was big or
little-endian (neet). To bad that OS didn't make it (well...it's not dead
yet).
"Daniel O'Connell" <EMail@HideDomain.com> wrote in message
news:NrV7b.417453$uu5.75746@sccrnsc04...
>
> "Magnus Persson" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> > The byte order is not wrong since Windows is big-endian. If you need to
> > control the byte order you can stream it byte per byte yourself. That
way
> > you can store integers in litte-endian instead. But why? If you use a
> binary
> > reader to read integers you will receive the same value as stored with
the
> > binary writer. I can see the problem if you write data on a big-endian
> > system and read the data on a little-endian system but that can all be
> > solved by adding a header containing information about the "endianess".
> >
> If, of course, you have any say in the format. Pretty possible thats been
> determined by parties well outside of the OP.
> Also, Intel chips are little endian and Windows and native programs, by
> extension, usually use use little endian integers nativly. The .NET CLR is
> big endian as I recall, which is frustrating at times for binary
> interopability with legacy native code. I assume that the JIT'er handles
the
> endian conversions for code execution, but that doesn't help with writing
> binary data.
> On other processors, the endian'ness (is there a proper term for this?)
can
> change. Assuming you get rotor or mono to work on the mac, you are on a
> processor that, I think, can be either. However, I believe Mac OS uses
> big-endian and native code would for that platform is more likely expect
big
> endian integers. I'm not sure on all these points, someone correct me if
I'm
> mistaken please.
> Its something we all have to be used to sometimes...
>
> > /M
> >
> > "Marko Maehner" <EMail@HideDomain.com> wrote in message
> > news:EMail@HideDomain.com...
> > > Hi!
> > >
> > > I have the following problem:
> > >
> > > I want to write an integer value (e.g. 14) with a binarywriter.
> > >
> > > The written file contains the following entry:
> > > 0E 00 00 00
> > >
> > > I want the entry to be the following:
> > > 00 00 00 0E
> > >
> > > Does anybody know how to get the desired result (Language vb)?
> > >
> > > Thanks in advance,
> > > Marko
> >
> >
>
>
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Net Framework |
- Next
- 1
- Visual C#.Net >> Modify IIS Folder PermissionI need to change Directory Security permission on folders under the IIS
default web site tree:
Internet Information Services
- Machine Name
- Web Sites
-Default Web Site
+testfolder
Specifically: on the the Directory Securty Tab (right click on a folder
under the Default Web Site) click the edit button next to Anonymous access
and authentication control, uncheck Anonymous access, check Basic
authenticatoin and enter Domain and password...and finally uncheck Integrated
Windows authentication.
I may have chosen the wrong class "IIsWebFileSetting" to change the
properties described above...which also could have added to the confusion.
I am using windows server 2000, with IIS 5.0
I know in the end we are really just changing/entering data in the IIS
metabase, right?
Thank you so much for taking the time to help....I'm really stuck on this one.
Mark
- 2
- ADO >> Problems with return parameter from Oracle functionI have an oracle function that looks like this:
AuthenticateUser(UserName IN VARCHAR2, pPassword IN VARCHAR2, AppName IN
VARCHAR2) RETURN VARCHAR2
Using the Oracle client provider, I'm setting up my command text as:
:results = call AuthenticateUser(:username, :password, :appname)
I then add parameters as follows:
OracleParameter p = new OracleParameter("results", OracleType.VarChar);
p.Direction = System.Data.ParameterDirection.ReturnValue;
p.Size = 255
xcmd.Parameters.Add(p);
xcmd.CommandText = _authenticateCall;
xcmd.Parameters.Add(new OracleParameter("username",
OracleType.VarChar)).Value = "abc";
xcmd.Parameters.Add(new OracleParameter("password",
OracleType.VarChar)).Value = "123";
xcmd.Parameters.Add(new OracleParameter("application",
OracleType.VarChar)).Value = "Test";
However, when I execute the command, I get an ORA-01036: illegal
variable name/number exception.
If I leave out the :results paramater from both the command text and
don't add it to the parameters of the command, then I can call the
function w/o the exception. So it seems like .Net can't figure out how
to bind my parameters correctly (this is more or less confirmed by the
stacktrace of the exception).
In every example I've seen, this is the recommended way of calling a
function. What am I missing that would make it bind the return parameter
correctly?
- 3
- Microsoft Project >> "resource usage"- view errorHi..
I open a Project and use the reource-usage view. I choose a resource and
look at the actual work by other enterprise Projects. The actual work of
all the other projects is 0 although I am sure thet they are not .
What is the reason for this problem?
Thanks..
- 4
- Microsoft Project >> Project 2007 Not Enough Memory to PrintOur schedule won't print more than once at a time. If we do a print preview,
it won't print at all. The message, "There is not enough memory to complete
the operation. To free up available memory, close programs, projects, or
windows you aren't using, and then try again." I can close all but Project,
and it still won't print. The only thing that works is to close Project,
reopen it, then open the project without previewing it. It prints fine, but
cross your fingers. If it is two pages wide, you won't know until you waste
a ream of paper.
- 5
- Microsoft Project >> Printing in MS Project 2007Does printing in MS Project 2007 just not work like it did in 2003.
I am having a terrible time getting all my info on my gantt chart to print
and it will not do a "fit to" at all.
Starting to wonder if I should just go back to 2003.
Extremely frustrated.
- 6
- 7
- Visual C#.Net >> Running code compiled in Framework 1.0 with Framework 1.1Hello,
We have an application written using Framework 1.0 (VS2002), we have
deployed it to a server that only has Framework 1.1 installed, the
client does not want to Install Framework 1.0 because it might have an
impact with other .Net applications written using Framework 1.1, so
rather not getting into a debate with the client I have agreed to
investigate if we could get our application to run using Framework 1.1
without recompiling it. Is this possible, if so how?
Thanks,
- 8
- ADO >> Column Expression questionHello!
After filling table into DataSet (ds), I added following line ...
ds.Tables(0).Columns("MyColumn").Expression = "<MyFormula>"
... and calculation is working fine - but I need to save this calculated
field value into database also because it makes easier to make SELECT
queries later and it's quite often needed value in many cases too. This
"MyColumn" is as a field in database too, and is used too when making
DataAdapter in SELECT-query.
When trying to save, I'll get error message ...
"The column mapping from SourceColumn 'MyColumn' failed because the
DataColumn 'MyColumn' is a computed column."
Is it possible to save computed column values into database table at all?
--
Thanks in advance!
Mika
- 9
- Visual C#.Net >> IsAccountLocked and LDAPI think IsAcountBlocked does not work with Active Directory if the conection is an LDAP:// configuration. Am I right? Does someoe have an example with WinNT://
Thanks
Jason
- 10
- Dotnet >> icon for desktop shortcut not workingHi all,
I am attempting to deploy a vb.net application. That is working fine.
I also configured the installer so shortcuts for the application
would appear on the desktop and the user program menu. That's working
too. What isn't working is the icon that I am setting for these
shortcuts. The icon is a .ico file that works fine for the program
itself, and for any shortcuts that I manually create. After I created
the shortcuts of the primary output in the file system editor, I set
the icon property to my .ico file. However but the shortcut s that
result from installation still show your basic, generic "file" icon.
Anybody have any idea why the icon isn't appearing on the shortcuts
created by installer? I followed the .net help file instructions
exactly!
thanks,
Mike Cooper
- 11
- ADO >> Convert System.Transactions.Transaction.Current to System.Data.Common.DbTransaction?I have been trying to figure out a way to convert
System.Transactions.Transaction.Current to System.Data.Common.DbTransaction
with no luck so far. Is this even possible? I am using the Enterprise
Library, and several of their calls take in a transaction, but it is of type
DbTransaction. I have tried straight casting, but it is not compileable.
DbTransaction transaction = (DbTransaction)Transaction.Current;
Error 1 Cannot convert type 'System.Transactions.Transaction' to
'System.Data.Common.DbTransaction'
- 12
- 13
- Microsoft Project >> Project should provide "print across then down" like ExcelIs there a way to "print across then down" in MS Project like you can do with
Excel? I'm printing my Gantt chart 2 pages wide by 5 pages high, and it's
annoying that the bars that go with page 1 are on page 6.
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/community/en-us/default.mspx?mid=941d70e0-2117-47fa-a491-1ff5a3154e4d&dg=microsoft.public.project
- 14
- Winforms >> VB6 Form Upgrade to .Net ErrorI am upgrading a VB6 application to VB.NET. In the VB6 application I have a
form with a sub called ShowScreen that takes arguements. This has always
worked with no problem/ When I try to upgrade I get the Buil error
"'ShowScreen' is not a member of 'System.Windows.Forms.Form'".
How do I resolve this issue? This might be related to the issue for some of
my Sheridan controls "losing" some of their properties and methods.
Thanks,
Kirk
- 15
- Visual C#.Net >> Windows Services and System.Web.UI.Page.RequestHi.
I am wondering how to handle AbsoluteUri values inside windows
services?
It seems that the absoluteuri is called from the System.Web.UI.Page
namespace
which is not allowed inside a windows service (that I am aware of).
But, I need to call the following inside my service:
Request.UserAgent,
Request.UserHostAddress,
Request.Url.AbsoluteUri
Since I can't use the Request object (in the sense of
System.Web.UI.Page),
how do I access the above values from within my service??
Thanks for your help.
Peter
|
|
|