|
hi its something like i press a button then it produce a num for eg: 001 then after i close the application , for the second time i press the button it will generate 002..and so on.. something like a receipt num..thanks
|
|
|
|
|
i fear that cant be done. When u close the application then all the datas in memeory will be cleared. Or else wht v can do is v should create a database with one table and at the click of a button u should update a table. then even if u close the application the previous value will be stored in the database so that the next time v can get the value from table in the database.
Vipin
|
|
|
|
|
Vipin Venugopal wrote: v can get the value
Vipin Venugopal wrote: Or else wht v can do is v should
Your laziness is obvious by the fact you cant be bothered to type "you" - but to not even check that you've hit the wrong key every time and put "v" thats just .
|
|
|
|
|
it was actually v i ment not u. I just wanted to say v as a codeproject group. Iam sorry u took it in the wrong sense.
Vipin
|
|
|
|
|
"v" dun have to apologise.. becos if we are jus playing with the short-form of e language and vipin n i can understand , y should we stop communicating like tt? btw Mr condor wht do u mean by "Clarity is the difference between writing a great program and writing something that looks like it came out of India."do u mean programs from indian programmers can not make it? or u mean there is something wrong with india? please do not critise other country and do not post racism remarks!! its an insult to yrself n others.. spare a thought to yrself n others..think before u speak please..wht is the point if u can write a great program but cant think rationally..
|
|
|
|
|
Ive just read through this entire thread and although I could jump in and help you out I cant be bothered...just like you cant be bothered to type properly (in words) instead of gastly SMS-Speak.
In addition, you asked just before the weekend how to make a sequence of numbers where the next sequence number is remembered between sessions. You were given perfectly reasonable answers such as "store the last value when the app closes, and reload that value when it reopens. You could use a database, an XML file, or a text file".
If you have a follow up question, then do post it, but please try to use English and not SMS!
|
|
|
|
|
hey jamie , forum is supposed to be short n sweet to the point .. if u have pro understanding basic short-hand maybe u should take up some courses in yr country.. but guess this is common sense n there might be no cos to help a poor soul like u
anyway i have mentioned i have got no basic programming BG at all so i cant really understand but pardon me tt i only can understand detailed help..i dun think im doing anything wrong as im willing to learn
if Vipin can understand n help , i cant undersatnd wht u r unhappy abt..
|
|
|
|
|
Jamie,
You are not helping yourself by using such crappy shorthand to ask a question. And Vipin is not helping you by giving you source code, because the next time you need to figure something out you won't know how to find the answer.
As a beginner you should be clearly aware of the fact that in the development environment clarity is the difference between getting help and getting ignored. Clarity is the difference between writing a great program and writing something that looks like it came out of India.
Knowing how to get an answer and knowing how to ask help in a clear and precise manner is how you grow as a developer.
|
|
|
|
|
hey man come on. its not the matter of US english or UK english v all r here. its just to help our friends who r in need of help. May be u r too good in english and some r not. but what matters here is to make others understand what u r saying and if possible share with other what u know so that others can also get to do that. If u r trying to find fault with others may be because ur born for that. I have been posting here in CodeProject for quite a long time and till this date nobody has complained me that they didnt understand what i explained to them and taking that into consideration i dont feel that i should change my language just because u said so.If u can solve others problem then u will be very well appriciated so try to help others than trying to find fault with others.
Vipin
|
|
|
|
|
hi all, i have linked up 2 proj but when i debug they come out together..i search online but i cant find help that can allow my second proj to run only after my second proj..can anyone help? thanks
|
|
|
|
|
Guess this goes back to clarity as well, but your question is not asked in a very clear manner. Assuming by linked you mean they are in the same solution, maybe this will help you:
When you put several projects into a solution, you are then telling the system that they belong together. If you want to run one project then the other, you need to write a third project (maybe a console app?) that does the workflow management of the sequence of projects to run.
However, since you never even specify what type of projects you have put together or what you mean by 'linked' then my answer is just a guess.
|
|
|
|
|
wht do u mean by write a third project (maybe a console app?) is there any articles which u can link me to ? thanks
|
|
|
|
|
Hello. I am teaching myself more .NET, really love the technology.
I've created a simple desktop application. Basically, its a database frontend for an inventory management system.
The databse is simply an Access file (.mbd) which is in the same directory as the executable. In other words, my oleDbConnection objects look for the database (.mdb file) in the same directory.
You see, this application will be independantly run on different PCs (each PC is in a different branch of our shop). I want to make all the different PCs share the same database. Ofcourse, the PCs will be connected (via LAN) to a central database server (where my .mbd file will be stored).
In essence, all I want to do is make my application look for the .mbd file on the database server, instead of localdisk. However, there are some issues which I dont know how to address:
1) I guess the simplest way to achieve this is to create a shared network folder. But I dont think this solution is elegant... because it seems I have to hardcode the network path into the program (specifically, I have to hardcore the ConnectionString of the oleDbConnection object)
2) How do I keep the data synchronized? (ie, Race condition)
The naive way to do this would be simply allow the database to throw an exception, and simply make the user "try again". But I want a more robust solution.
In University, I learnt how to tackle race conditions in the same application using Semaphores, Monitors, etc. But I have no idea how to do it via networks.. since I am no longer dealing with Threads anymore.
I would sincerely appreciate if someone could guide me in the right direction. I am sure there are well-establish methodologies for achieving this... a nudge in the right direction will help. A link, a book, anything.
|
|
|
|
|
1) Get away from Access. That is a piece of crap. Use SQL Server Express which will allow you to migrate your application to a full-blown SQL Server without programming changes.
2) You access the remote database with a connection string. This specifies which server to look for the database on.
3) You get away from hard coding (somewhat) by putting the connection string in your application config file.
You may, however, make sure you are running the right version of Visual Studio to ensure you have the remote capabilities exposed to you. (Visual C# Express, for example, has a lot of functionality stripped from it.)
|
|
|
|
|
Hi,
How to create a setup in C# which should install database (Sql Express) and .NET Framework?
Plz Help
|
|
|
|
|
Have a look at NSIS[^]
All the Best
Akhil
|
|
|
|
|
Hi i created a c# project for MS Mobile 2005. I cant seem to get the screen to stop flickering. I try double buffering it but it still flickers like crazy. I created a timer that calls my tick method and refresh to call paint every 50 millisecond. Can someone please help me, im very new to C#. i can send the project to u if you need it to help. Its a simple game im trying to port from java to c#.
Please help,
Jan
|
|
|
|
|
just send the code so that v all can figure out what the exact reason is. without seeing the code its difficult to say what causes flickering even after buffering.
Vipin
|
|
|
|
|
Here the code
The Form, the timer and the onpaint
<br />
protected override void OnPaint(PaintEventArgs pea)<br />
{<br />
game.onPaint(pea.Graphics);<br />
this.Invalidate();<br />
}<br />
<br />
private void gameTimer_Tick(object sender, EventArgs e)<br />
{<br />
game.tick();<br />
this.Refresh();<br />
}<br />
I have a Game class, which is pasted below, i remove the other non-important code and pasted tick and paint only.
<br />
class Game<br />
{<br />
Bitmap bufferImage;<br />
public int tile_size;<br />
public Game(Form1 parent_)<br />
{<br />
parent = parent_;<br />
height = parent_.Height;<br />
width = parent_.Width;<br />
int zW = width / 3;<br />
int zH = height / 3;<br />
tile_size = zH>zW?zW:zH;<br />
offsetX = (width - (tile_size * 3)) / 2;<br />
offsetY = (height - (tile_size * 3)) / 2;<br />
bufferImage = new Bitmap(width, height);<br />
<br />
loadImage();<br />
startGame(ARCADE);<br />
}<br />
<br />
public void tick()<br />
{<br />
DateTime currentTime = System.DateTime.Now;<br />
TimeSpan duration = currentTime - timeTick;<br />
<br />
if (state == PLAY && gameType == ARCADE)<br />
{<br />
for (int i = 0; i < 3; i++)<br />
{<br />
bool toLevelup = true;<br />
if ((arcadeLevel[0,0] != -1 && arcadeLevel[0,1] != arcadeLevel[0,2]) ||<br />
(arcadeLevel[1,0] != -1 && arcadeLevel[1,1] != arcadeLevel[1,2]) ||<br />
(arcadeLevel[2,0] != -1 && arcadeLevel[2,1] != arcadeLevel[2,2]))<br />
{<br />
toLevelup = false;<br />
}<br />
<br />
if (toLevelup)<br />
{<br />
level++;<br />
init(ARCADE);<br />
}<br />
}<br />
}<br />
else if (state == PLAY && gameType == SURVIVAL)<br />
{<br />
duration = currentTime - timerSpeed;<br />
if (duration.TotalMilliseconds >= 60000 && spawn_time > 0)<br />
{<br />
spawn_time -= 50;<br />
timerSpeed = currentTime;<br />
level++;<br />
}<br />
}<br />
<br />
int position, character;<br />
duration = currentTime - timerGame;<br />
if (duration.TotalMilliseconds >= spawn_time)<br />
{<br />
int count = 0;<br />
bool generated = false;<br />
while (!generated && count < 10)<br />
{<br />
position = Math.Abs(random.Next() % (9));<br />
<br />
if (checkPlaceable(position))<br />
{<br />
generated = true;<br />
<br />
character = CHAR_PUTSU;<br />
addCharacter(character, position);<br />
}<br />
count++;<br />
}<br />
timerGame = currentTime;<br />
}<br />
<br />
Tile tile;<br />
for (int i = 0; i < landMap.GetLength(0); i++)<br />
for (int j = 0; j < landMap.GetLength(1); j++)<br />
{<br />
tile = landMap[i,j];<br />
if (tile.isHole && tile.character != CHAR_EMPTY)<br />
{<br />
duration = currentTime - tile.timerAnimate;<br />
if (duration.TotalMilliseconds >= ANIMATION_SPEED)<br />
{<br />
tile.charImgIdx++;<br />
tile.timerAnimate = currentTime;<br />
}<br />
}<br />
}<br />
<br />
if (life <= 0 && state == PLAY)<br />
{<br />
highscorePos = processHighscore();<br />
if (0 < highscorePos)<br />
{<br />
state = OVER;<br />
}<br />
else<br />
{<br />
state = END;<br />
}<br />
}<br />
timeTick = currentTime;<br />
DateTime currentTime2 = System.DateTime.Now;<br />
duration = currentTime2 - currentTime; <br />
}<br />
Graphics g = null;<br />
public void onPaint(System.Drawing.Graphics g_)<br />
{<br />
if(g == null)<br />
g = Graphics.FromImage(bufferImage); <br />
<br />
Tile tile;<br />
for(int i=0; i<landMap.GetLength(0); i++)<br />
for (int j = 0; j < landMap.GetLength(1); j++)<br />
{<br />
tile = landMap[i,j];<br />
if(tile.isHole == true)<br />
g.DrawImage(imgTile[1], tile.pixelX, tile.pixelY);<br />
else<br />
paintClipImage(g, imgTile[0], tile.pixelX, tile.pixelY, tile.landImgIdx * tile_size, 0, tile_size, tile_size); <br />
<br />
if (tile.character != CHAR_EMPTY && !tile.isWacked && tile.isHole)<br />
{<br />
if(tile.charImgIdx >= ANIMATION_SEQUENCE.GetLength(0))<br />
{<br />
tile.character = CHAR_EMPTY;<br />
}<br />
else<br />
{<br />
tile.repaint = true;<br />
paintClipImage(g, imgCharacters[tile.character], tile.pixelX, tile.pixelY, ANIMATION_SEQUENCE[tile.charImgIdx] * tile_size, 0, tile_size, tile_size); <br />
}<br />
}<br />
<br />
if (tile.character != CHAR_EMPTY && tile.isWacked && tile.isHole)<br />
{<br />
if (tile.charImgIdx > 1)<br />
{<br />
tile.character = CHAR_EMPTY;<br />
tile.isWacked = false;<br />
}<br />
else<br />
{<br />
tile.repaint = true;<br />
paintClipImage(g, imgCharacters[tile.character], tile.pixelX, tile.pixelY, (ANIMATION_WACKED + tile.charImgIdx) * tile_size, 0, tile_size, tile_size);<br />
if (tile.hammerIdx < HAMMER_IDX_MAX)<br />
{<br />
int spaced = CHAR_WIDTH - HAMMER_WIDTH;<br />
paintClipImage(g, imgHammer, tile.pixelX + spaced, tile.pixelY, tile.hammerIdx * HAMMER_WIDTH, 0, HAMMER_WIDTH, HAMMER_WIDTH);<br />
tile.hammerIdx++;<br />
}<br />
<br />
if ((tile.character == CHAR_MONG || tile.character == CHAR_PUTSU || tile.character == CHAR_PIPKOW) && tile.hitAble && tile.powerCycle > 0)<br />
{<br />
int powerY = tile.pixelY + (CHAR_WIDTH / 6) * tile.powerCycle;<br />
g.DrawImage(imgPow, tile.pixelX, powerY);<br />
tile.powerCycle--;<br />
}<br />
else if ((tile.character == CHAR_MOTERO || tile.character == CHAR_MONG) && !tile.hitAble && tile.powerCycle > 0)<br />
{<br />
int powerY = tile.pixelY + (CHAR_WIDTH / 6) * tile.powerCycle;<br />
g.DrawImage(imgMinusHeart, offsetX + tile.pixelX, offsetY + powerY);<br />
tile.powerCycle--;<br />
}<br />
}<br />
}<br />
}<br />
<br />
g_.DrawImage(bufferImage, 0, 0);<br />
} <br />
<br />
}<br />
Please help
Thanks,
Jan
|
|
|
|
|
Solutions:
Add this method... and it doesnt flicker anymore
<br />
protected override void OnPaintBackground(PaintEventArgs pevent)<br />
{<br />
}<br />
|
|
|
|
|
i need a connection string for excel file
thanks for help
MD_NADA
|
|
|
|
|
|
How to get information about starting new process in my c# app ?
Something like new process listener. Process would be started manualu by user.
|
|
|
|
|
Is there any packers for .NET apps such as: http://upx.sourceforge.net for win32?
Thanks
|
|
|
|
|
An installer like NSIS will have better compression results, but in this day and age, UPX isnt really useful.
|
|
|
|
|