|
Sorry... didn't finish the code from above.
after adding the newRow to the DataTable (dt), you need to add the following to update the DataGrid (dg):
dg.DataSource = dt;
John
|
|
|
|
|
--------------------------------------------------------------------------------
Can someone help me in making a barcode checking in C programming language? The barcode is using EAN-13 code, which was normally grouped as 1-6-6. The code should check code like 9 300605 013278, and print out a message whether it's a valid barcode.
The requirement for a valid barcode is that:
• Add up all the even-numbered digits, and multiply the sum by 3:
3 + 0 + 0 + 0 + 3 + 7 = 13; 13 * 3 = 39
• Add up all the odd-numbered digits (including the check digit):
9 + 0 + 6 + 5 + 1 + 2 + 8 = 31
• Add up the two totals; the result should be divisible by 10:
39 + 31 = 70
Thanks and cheers for the help!!
|
|
|
|
|
llyod wrote: in C programming language
Wrong forum.
By the way the problem you present requires only simple mathematics and it shouldn't be that hard to code this by yourself.
"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
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
Hi
I would like to create windows service for an application in c#.Basically, I have done like this. I make a function to send mail, function name sendMail () in class1.
Now, I have added one project WindowsService1 in existing application. In a WindowsService1 project,
I have written code on start() event in service1.cs. Just I made an object of calss1 and call the function SendMail. Service is successfully installed but not starts.
I am trying to start service but unable to start service. One message is displayed like this
“The Mailer service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service”.
Actually, I have some queries regarding windows service.
1) Can I call any function on OnStart () event in Windows service project.
2) How to mange windows service OnStart () event and OnStop () Event?
Any help is appreciated
Regards,
Rajesh
rajesh
|
|
|
|
|
i want to set mediaplayer start my sound at specific position,
there is this code :
axWindowsMediaPlayer1.Ctlcontrols.currentPosition
but it is readonly , and i couldnt set it !!!
|
|
|
|
|
I found it myself , it was easy , just with using following code:
axWindowsMediaPlayer1.Ctlcontrols.currentPosition = 90;
90 is 1:30
|
|
|
|
|
I want to show the log file to the user. the file size could be approximately 100 kb and the file can have hundreds of lines in it. What are the possible ways to show that file to the user by highlighting the lines having 'Error...' in it. I also want to do it efficiently so that the parsing can't affect the speed of the application.
sAqIb
|
|
|
|
|
I think your best bet would be creating a simple form with a RichTextBox inside. There should be many code examples, tutorials and/or articles in the internet that cover syntax highlighting with RichTextBox.
"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
|
|
|
|
|
dear programers
in sqlservr database i made field type 'nvarchar' and 'ntext' does not work.
how can i Encode and Decode the utf-8 characters so that i can easly save to database
sikandar
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
If you have a text saved as UTF-8, you can load it with a StreamReader using the Encoding.UTF8 encoding. When you read a string from the stream it will be decoded to Uncode, that you can store in the database.
---
b { font-weight: normal; }
|
|
|
|
|
HI
i am new in c#
plz tell me
how to define the below in c#
struct link
{
int info;
link *next
};
struct link *start=new link;
Parshant
|
|
|
|
|
Well, you can't have a pointer, so
struct link
{
int info;
link next
};
struct link start=new link();
You don't want to be writing linked list classes tho, you should just use the ones built into the framework.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
sir plz tell me how with abov e.g
|
|
|
|
|
I don't understand - I converted your struct to C#, what else did you need ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I guess he tried to compile your code and it failed. It doesn't work because you're trying to create an instance of the struct as a member of the very struct you're defining, so it becomes kinda like an infinite recursive definition.
|
|
|
|
|
Structs works differently in C# than in C. In C# a struct is a value type and a class is a reference type, while in C a struct is just a definition and the type depends on how you use it.
As you want to have references to your objects you would want it to be a reference type, so you use a class:
class Link {
public int info;
public Link next;
}
Link start = new Link();
---
b { font-weight: normal; }
|
|
|
|
|
Good point
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How to create report in VS.Net 2003 using C#
namita dang
|
|
|
|
|
How to create report in VS.Net 2003 using C#
Jitendra Tyagi
|
|
|
|
|
|
Hello
how to make image transparent in Win Appl in c#.NET so that I can see controls behind it,what r the properties that I have to changes for it.
Thanking you
Yogesh_T
|
|
|
|
|
how to map an object of the so called real life to programming world.
Say there is a car. How can we take this to programming world. Car with wheel, engine, etc. Car
can move without even doors, it's movement will be effected if one wheel is with low air pressure.
etc.
Here car should be an object, wheel also an object. Car has wheels, doors etc., but wheel has different
impact than doors as far as motion is concerned.
Can someone help me visualize this object to OOP?
|
|
|
|
|
You can't, not really. Every car has some stains on the seats, are you going to bother to map those ? Chips in the paint ? Oil on the engine ? No. You choose the bits that are important to what you want to write, and you map those to classes. Getting it exactly the way it is in the real world is not the point, mapping the bits you want to interact with so they work smoothly in your program, is.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
>>You can't, not really.
Help me to some extent.
>>Every car has some stains on the seats, are you going to bother to map those ?
Yes, anything with some volume should be able to interact with the seat. There some physics rules should come handy. and so on
>> Chips in the paint ?
Yes, again some interaction with the environment. How environment can effect the car?
>> Oil on the engine ?
Yes, of course. Help me outhere as well.
>> No. You choose the bits that are important to what you want to write, and you map those to classes. Getting it exactly the way it is in the real world is not the point, mapping the bits you want to interact with so they work smoothly in your program, is.
'm want to simulate the max possible.
|
|
|
|