|
Wouldn't Access itself prevent the user from saving data while another process is reading it? I tried setting FileShare.Read, but I get the IOException.
|
|
|
|
|
eggsovereasy wrote: Wouldn't Access itself prevent the user from saving data while another process is reading it? I tried setting FileShare.Read, but I get the IOException.
Drop back to not specifying any FileShare stuff in the FileStream constructor - that should be the equivalent of FileShare.None. I'm not sure why I suggested FileShare.Read: it won't do you any good, and there may be some goofiness in doing that over a network share. When Access opens the mdb file, I'm willing to bet it opens it with the equivalent of FileShare.None as well, because Access (well, the MS Jet DB engine underneath it all) was never designed to be a multi-user DB system, to my knowledge.
BTW: Typically, you can tell if someone else has the FileName.mdb open by looking for a file named FileName.ldb in the same directory. Access creates the FileName.ldb while it has the FileName.mdb open, and removes it when it closes FileName.mdb. It's not a 100% guarantee, however, because if Access doesn't exit cleanly the FileName.ldb sticks around until someone opens up the FileName.mdb again and exits Access cleanly.
"I hope he can see this, because I'm doing it as hard as I can" - Ignignot
|
|
|
|
|
Hi all
I hv used a repeater to display panels on my form. I am using CollapsiblePanelExtender(ASP.NET AJAX 1.0) to expand or collapse the panels generated by the repeater.
My problem is in one of the panels i hv used a linkbutton.on click event of linkbutton i want to access the text of linkbutton, but whn i click the linkbutton client-side coding of collapsible panel gets called n i can't access server side coding of repeater_ItemCommand event.
Plz can anyone help me out...
|
|
|
|
|
I'm looking for information on the right way to draw to two different windows using a single DirectX device. The biggest key is
device.Present(overrideWindow)
but SwapBuffers also seem to be involved, and perhaps the Viewport settings may make a difference.
I'd appreciate pointers to a good resource, comments, or suggestions. Working source code, of course, is even better.
- - - -
further detail:
I am currently drawing one window with 2 viewports and Present() it. Then I draw the other window with a single viewport and Present(win2) it. The second window's viewport size gets misinterpreted, somehow, and it doesn't fill the second window even though it is explicitly set to use the window's full width and height. The first window's display is (not suprisingly) duplicated in the region not filled by the viewport on the second window. Drawing withing the viewport on the second window is correct. I do not have a separate SwapBuffer for the second window, since it doesn't seem necessary, and it is unclear to me what benefit it would provide.
- - - -
Mark
|
|
|
|
|
Hi,
I have a basic command line application and I want to store a username and password it can use to access a web service. Is there a simple way of doing this using System.Configuration ?
Also I'd like to store my password in an encrypted format. Is there some way of doing this?
Thanks
|
|
|
|
|
|
I often have trouble with class names because I am very pedantic in nature. Two days before deadline I should not be worrying about this at all, but I am. I often get uncertain naming classes that perform only one task, such as one I have now that submits a document to a web service. I don’t favour the clumsy sounding “DocumentSubmitter”, and “DocumentSubmit” sounds much better, but now my class name is no longer a noun. Are there any guidelines on this?
|
|
|
|
|
|
DocumentSumissionHandler?
Isn't there a Document class? Couldn't the document submit itself, removing the need for a special class for it?
---
single minded; short sighted; long gone;
|
|
|
|
|
No, I am of the design school that doesn't permit the document knowledge of the submission process[1]. This allows diverse submission channels without impacting the document. In this I could use your name or DocumentSubmissionEngine, to stick to the noun guideline, but these seem overly verbose, and the Handler suffix may incorrectly hint at a callback method.
[1] On something of a tangent, my favourite example of this debunks the popular OO example where a Customer knows how to Save itself. A real world customer is not aware of how the bank stores his details, nor of how the library stores his details. He is only aware of his details and how to derive certain facts from them.
|
|
|
|
|
Hi All
I have an application which requires me to use the PC com port to communicate with a PIC (16f877) micro-controller. I am planning to use the PC to fill a serial EEPROM with data which constitutes a digitized waveform of 100 samples. In other words the program on the PC needs to take in a text file which holds the values for 100 samples (in hex string/decimal string?) and transmit them on command to the PIC. The pic then takes the data and fills each address in the attached serial EEPROM with a sample value. So for instance, each sample can be between 0x00 and 0xFF (0 to 255) and I need to transmit it as a single byte so the PIC can deal with it.
In the past I have used outportb quite successfully. However, I am now using C# in Visual Studio 2005 and I was wondering if anyone has any suggestions how I can do the same/equivalent? I am having some trouble converting from a string to a byte... What I mean by this is that if the string is 255, I can only convert to a byte array which gives me a byte for 2, then 5 then 5..... What I really want is the byte equivalent to 255 (ie 1111 1111)... I hope this makes sense...
Any help would be gratefully appreciated.
Jamie
|
|
|
|
|
Try the Byte.TryParse method.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks for that.... On first look it does seem to do what I want. It's amazing how the simple things can cause so much trouble..... Now I just need to re-visit some assembly language to get my graphical display working correctly......
Cheers
Jamie
|
|
|
|
|
Hi,
you need SerialPort.Write Method (Byte[], Int32, Int32) to output arbitrary bytes,
and if your source is a text file with decimal numbers, then a loop containing
byte.TryParse() is the way to go.
If your string input is using hex, then you need NumberStyles.AllowHexSpecifier in
byte.TryParse()
|
|
|
|
|
Hi,
Heres a sample XML document:
<?xml version="1.0" encoding="utf-8"?>
<Sample>
<Name>
<!--Indicates the first name-->
<FName>A</FName>
<!--Indicates the Middle name-->
<MName>M</MName>
<!--Indicates the last name-->
<LName>B</LName>
</Name>
<ID>1</ID>
</Sample>
If i get the count of childnodes of the node <name>, using the following statement: xmlNamenode.Childnodes.count, it returns 6 (i.e) it also includes the comments as a child node. Is there any way to directly get the count of number of elemets (excluding comment nodes) instead of alll the childnodes?
Thanks in advance
Regards
Madhu
|
|
|
|
|
Xml naming convention is camelCase element names.
...
Use XPath. I believe there are several sample queries on the web that will give you the exact results you are looking for.
File Not Found
|
|
|
|
|
hi i want to acces a textbox text in the class file
wat i have to to do to get the values from forms in class
thanks
with regards
Balagurunathan.B
|
|
|
|
|
Please Help!
I have created a class:
using System;
using System.Data.SqlTypes;
using System.IO;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Server;
namespace mySQL
{
public class SQLCLRIO
{
public static void WriteToFile(String content, String filename)
{
SqlPipe sqlP = SqlContext.Pipe();
try
{
File.WriteAllText(filename, content + "\n");
}
catch (Exception ex)
{
sqlP.Send("Error writing to file : " + ex.Message);
}
}
}
}
The problem is when I try to compile it into a dll I get the following.
"Microsoft.SqlServer.Server.SqlContext.Pipe' is a 'property' but is used like a 'method"
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
remove the () at the end of the Pipe. You only have those if you are calling a method.
Ben
|
|
|
|
|
Remove ()
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello everybody.
I am working with MVS2005.My project is C# project
How can I make e table with 10 raws and 10 columns and draw a moving ellipse over table.
Thanks for all.
|
|
|
|
|
Hi,
I am not sure what you mean by table. If its just a visual thing, you might consider
using a Panel, and drawing in it:
- 9 or 11 horizontal lines
- 9 or 11 vertical lines
- your ellipse (redrawn based on a Forms.Timer for animation)
|
|
|
|
|
Now I do this.
private void timer1_Tick(object sender, EventArgs e)
{
X1 += 5;
Y1 += 5;
Invalidate();
SolidBrush myBrush = new SolidBrush(Color.Green);
dataGridView1.Refresh();
Graphics grfx = dataGridView1.CreateGraphics();
grfx.FillEllipse(myBrush, X1, Y1, 15, 15);
}
But I ask is there any other way to do this
|
|
|
|
|
Hi,
some remarks:
1. you should call Dispose() on all objects you create from classes that offer a public
Dispose() method as soon as you dont need the objects any more. It applies to both
myBrush and grfx.
2. you could keep myBrush alive and reuse it over and over.
you should not do that with grfx
3. I would do the painting in a paint handler, not the timer tick (but of course the
x1/y1 update and the Invalidate() belong inside the tick handler). AS a result the
ellipse gets redrawn also every time it got damaged (e.g. when moving another window
over it without having to wait for the next timer tick (dont know what its period is).
BTW The PaintEventArgs offer you a free graphics, so you then dont need CreateGraphics
anymore, and dont have to Dispose() it.
|
|
|
|
|
Hi
Can you send me a sample code how can I do this in paint handler
X and Y is updated in timer tick at 100ms.
|
|
|
|