|
|
thanks , but is it possible with String Format
|
|
|
|
|
Not to my knowledge.
|
|
|
|
|
|
The string.Format method is used to get a string representation of an object in the specified format. It is not intended to change the value of its arguments. You can use
int m = n % 100; to get the last two digits of the number. If at all you have to use strings to achieve the same answer, you can do this
string m = n.ToString().SubString(n.ToString().Length - 2);
|
|
|
|
|
|
if 2 users connect to access and run query that check the last number
increase this number and insert record to database.
Who gets the priority ?
why i see 2 duplicate records with the same number ?
thanks in advance
|
|
|
|
|
It sounds like you need a transaction; that's what they're for.
I also don't recommend Access.
|
|
|
|
|
What you need in this case is an auto-incremented number, such as a primary key, rather than relying on a number field which must be manually incremented. You could also increment the number when inserting the record, not before.
I also agree with PIEBALDconsult, don't use Access. SQL Express is FREE and more robust than Access in multi-user scenarios. It also easier to upgrade to a full SQL Server implementation when necessary.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: auto-incremented number
|
|
|
|
|
I need to copy data from mysql via xml to access database. connected to the ProgressBar. database contains multiple tables. is not a tutorial on it some? Thank you for your help. Mark
|
|
|
|
|
Why did you mark your question as a code block?
Make a connection to mysql
create a parameterised query to get the data from the table you want.
save the datatable resultset to xml (this is a waste of time)
close the xml
open the xml
read the data into a datatable
create a connection to the Access database
either write the data to the access tables over the connection.
Apply the values to the progress bar where appropriate.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
In general it is always good to try out something and then post a question here.
You should be able to achieve this using a BackgroundWorker thread.
Too much of heaven can bring you underground
Heaven can always turn around
Too much of heaven, our life is all hell bound
Heaven, the kill that makes no sound
|
|
|
|
|
What is the purpose of the XML stage? You can write code to directly transfer, assuming you have the ability to connect to both databases from a single machine.
|
|
|
|
|
Oslancz wrote: via xml
Probably needless.
In general, to copy data from one table to another (given that the two tables are identical):
0) Create a Connection to the source
1) Open the Connection
2) Use ExecuteScalar to get a count of records to copy, use it as the max value for the ProgressBar
3) Create a Command to select the data from the source
4) ExecuteReader
5) Create a Connection to the destination
6) Use the GetSchemaTable method of the DataReader to cobble up a parameterized insert Command for the destination
7) Open the Connection
8) Begin transaction
9) Read from the DataReader, jump to 14 if done
10) Set the parameter values
11) ExecuteNonQuery
12) Increment the ProgressBar value
13) Jump back to 9
14) Commit or rollback as necessary
15) Close the DataReader
16) Close the Connections
But you'll want to run it on a thread and then you'll need to avoid cross-thread problems.
I also recommend raising an event for each record copied, rather than hard-coding the use of a ProgressBar.
You can also decide how to handle duplicate records and referential integrity problems.
P.S. Furthermore, I would write it as a console application rather than a Windows application, but that's just me.
|
|
|
|
|
i want software that help me to draw forms style to make my clients see it before start design it on visual studio my purpose is to make forms style to clients before begining & to not spend alot of time design forms on visual studio then client edit it
thanks
md_refay
|
|
|
|
|
I don't know of anything like that.
I recommend just roughing it out in Visual Studio so you don't need to redo it all. Are you planning to succeed or to fail?
|
|
|
|
|
i just want to give clients like interface demo to deal on the end interface
so i don't want to spend time design application & redesign it again
md_refay
|
|
|
|
|
|
it take time i need to make PROTOTYPEto dir on clients
md_refay
|
|
|
|
|
How much time do you think it is going to take to draw out the interface in any tool?
Compared to dragging and dropping the actual components you are going to use onto a form in VS?
It doesn't mean that that is the final design, but it does mean that the customer can see exactly what they are going to get, and you can make changes to it in front of them. It doesn't have to work - just have the relevant components in place for a screen example. I do it all the time - it's quicker, and easier than p*ssing about with pictures, plus the customer can see the relationship between things.
Ask yourself this: How long will it take to draw a DateTimePicker in all it's various formats? And how long to dump one on a form and set the format?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Exactly, but why create one that you'll just have to throw out and not leverage into the full-fledged app?
|
|
|
|
|
Assuming you have a reason you don't want your client to see Visual Studio running, with your prototypes of Forms displayed, the simplest method is to take screen shots of your VS prototypes, and crop out everything you don't want the client to see.
See the 'Free Tools' forum here on CP for recommendations of free screen-capture utilities.
If you want to get really fancy, and make screen recordings, you can use tools like Snagit (not free).
best, Bill
"In the River of Delights, Panic has not failed me." Jorge Luis Borges
|
|
|
|
|
Expression Sketch does exactly what you want. It's from Microsoft.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
The forms designer is pretty good for this purpose. There is a school of thought that says that something which looks 'final' like that is not so good for getting feedback, and recommends tools like Balsamiq. Personally, when I'm going over initial ideas with people (clients or team-mates) I use paper and pen/pencil/crayon.
|
|
|
|