|
snorkie wrote: make sure the column you are saving to is a string column
If it is number store it as number. Let UI decide how to formate that number.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
You should do something like:
decimal amount = decimal.Parse(textBoxName.Text);
where textBoxName is the name of your text box. You should save this into the database as a decimal data type, the formatting is not important. You should also look up decimal.TryParse as it will probably be more useful.
|
|
|
|
|
Hello,
You should convert the string to a double value, using double.TryParse (with the CurrentCulture setting).
And than do the String Format.
Here an example with a dynamic number of decimal places:
string text = "123";
string formatedText;
int NumberDecPoints = 2;
double d = 0;
if(double.TryParse(text, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.CurrentCulture,out d))
{
formatedText = String.Format("{0:F" + NumberDecPoints.ToString() + "}", d);
}
All the best,
Martin
|
|
|
|
|
Are you trying to save the value from the TextBox Control '12036' to the database as '12036.00'? Two things I would check. Make sure the column in the database is a varchar, string or a decimal value. Second, use the decimal.Parse method to get the correct format, then send it to the database.
|
|
|
|
|
Hi,
Actually I want to execute all events of web application through request….,
but I only succeed for button's click event and not for all other like image button and anchor element like that…….
The difference between button event & image button event is that button event is related to delegate System.EventHandler and image button to System.Web.UI.ImageClickEventHandler. The link button event also works fine through request because it's event also related to delegate System.EventHandler....
I have also problem with how to call the click event of anchor element bcaz it is client side element.
I am implementing all these from windows application…..., If u have any information then please reply….……..
Bye....
Dipti
|
|
|
|
|
i have to develope an image processing program.
images r face pics.
i find acne scars, shadowed areas then draw lines around of them.
how do i do ? how can i find out this scars.
where is the start point?
|
|
|
|
|
I've not actually tried this sort of thing, but I've heard it is pretty complicated, the subject of PhD theses and research projects. That being said it's an interesting puzzle.
Edge detection may be of some help:
http://en.wikipedia.org/wiki/Edge_detection[^]
Also you could look at the wikipedia on Feature Extraction (The bit about image processing is relevant)
http://en.wikipedia.org/wiki/Feature_extraction[^]
I'm not sure whether there is any research applying AI techniques (e.g. fuzzy logic or nueral networks) to this problem, but that might be worth some research. You might want to look at functional languages such as F#, Scheme or Haskell etc for handling the maths as it will be quite involved.
Good luck anyway.
|
|
|
|
|
greekius@hotmail.com wrote: i have to develope an image processing program.
images r face pics.
i find acne scars, shadowed areas then draw lines around of them.
how do i do ? how can i find out this scars.
where is the start point?
This will be a very difficult project. I don't even have a guess as to how to start, but if I was you, I would talk with your project manager. If you don't know where to start, you probably aren't qualified for that specific project.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I develope alone no project Manager. if there is one, He is me
|
|
|
|
|
This is seriously going to take a lot of work, and im talking months of work.
Unless you know an extensive amount of GDI+ and some image algorithm's to do this, you're probably better off getting a third party program that specializes in this.
But if I were to start somewhere, it would definitely be researching. Unless I know how to do it, I would start researching about it. Look for Image processing/cleanup in google, maybe that could give you a good starting point.
|
|
|
|
|
I've got a GUI which sends commands to a console exe, my backend which does the actual processing. But whenever my frontend calls it, it opens a command console window (even though I don't have any output on screen), but I'm having difficulties to find:
- whether I can force the pop-up exe to always stay in the back
(I was thinking on a) calling the exe b) immediately getting focus back on my GUI)
- maybe there's a way to call the exe, as I'm doing, but send it's window to the system tray (not like the icons and clock of Windows, I mean the space on the left to it, like most programs when you manually minimalize them)
But the prefered way how I'd like to handle it:
- have the exe and it's totally obsolete console window, be nothing more than a process I can find in Taskmanager. AKA not visible to the user.
Any ideas?
|
|
|
|
|
You can use process class to launch the another process. If you wan't that process to run in an invisible mode then create an instance of ProcessStartInfo class, set its WindowStyle property to Hidden and set CreateNoWindow property to true. Then use the ProcessStartInfo object to start a new invisible process.
|
|
|
|
|
Why should I ALSO set the CreateNoWindows property to true, if the WindowStyle is allready invisible? I've tried it, and don't see why I should use the CreateNoWindows.
|
|
|
|
|
Because from some programs setting WindowStyle to invisible is not enough
|
|
|
|
|
Hi,
I need to add a custom menu item to the file menu's export to option in infopath 2003 form. can any one help?
Regards,
Lavanya
|
|
|
|
|
in my application my application needs to access the db every time and the problem is , do i have to keep the connection open untill the application finishses . or after retreiving data do i have to close the connection each and every time ..
if i'm going to keep the connection open all the time it will affect the concurrency of the db because i'm using ADO.net.
if i'm using the second option i'll have to open the connection each and every time i use the db which will increase the network traffic .
what would be the best option to my application where there are about 30 users.
and i also like to know the standrad way or the most advantageous way of doing this ....
|
|
|
|
|
prasadbuddhika wrote: the connection open all the ti
A drain on the costly system (network) resources.
|
|
|
|
|
If you really need it open all the time, then have it open all the time.
Much of what I write is Windows services; they execute periodically, sleeping between cycles. I open the connections at the start of the cycle and close them at the end of the cycle. There is no need to keep them open while the service is asleep, but I also wouldn't want to have to open and close with each transaction.
|
|
|
|
|
Hi prasadbuddhika,
I suggest to do two things.
1. Ensure that Connection pooling is not disabled in your connection string.( By default this will be enabled).
2) Close the connection as soon as possible.
The reason is when he conenction pool is enabled and you close the connection the connection will not be closed physically thus in that time if another list conenctes with the same connection string SQL will not create a new connection rather then opening a new connection.
Thus you will not have to take the burden of opening more conncection also dont have to pay for time caused to open a new conenction.
Also try using the Sql Profiler to see how many times Sql server needs to open a new conenction.
Thanks
laddie
|
|
|
|
|
Hi All,
I want to create a space After similar values in Excel.For instance...
Column A -------------- column B
11222 A
11222 B
11222 A
11333 C
11333 C
11333 A
11333 B
11228 C
I want to create a space after a new value starts in column A.That is to say to insert an entire row in Excel sheet.So that i vcan group similar datas in Execl together.I have lots of data to group.
Can you please help?
Thanks
|
|
|
|
|
kibromg wrote: Spreed Sheet
Did you mean Spread Sheet?
|
|
|
|
|
Thanks
Yes,But they are generated in C sharp application.
regards
|
|
|
|
|
Hi
could you please see the could below.
/* Product.cs*/
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace Product
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private bool logicalControl()
{
if (txtproductcode.Text == "")
{
MessageBox.Show(this, "Please enter the product code",
this.Text,
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
return false;
}
if (txtproductamount.Text == "")
{
MessageBox.Show(this, "Please enter the stock amount",
this.Text,
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
return false;
}
if (txtproductprice.Text == "")
{
MessageBox.Show(this, "Please enter the unit price",
this.Text,
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
return false;
}
if (grupBox.Text == "")
{
MessageBox.Show(this, "Please enter the group",
this.Text,
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
return false;
}
return true;
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void Insertproduct(string pCode, string pName, string pAmount, string pPrice, string pGrup)
{
OleDbCommand cmd = new OleDbCommand("INSERT INTO [Product_List](ProductCode, Brand, Stock, Price, Group) VALUES(@Code, @Brand, @Stock, @Price, @Grup)", Connection.GetConnection());
cmd.Parameters.AddWithValue("@Code", pCode);
cmd.Parameters.AddWithValue("@Brand", pName);
cmd.Parameters.AddWithValue("@Stock", pAmount);
cmd.Parameters.AddWithValue("@Price", pPrice);
cmd.Parameters.AddWithValue("@Grup", pGrup);
cmd.Connection.Close();
cmd.Connection.Open();
cmd.ExecuteNonQuery();
cmd.Connection.Close();
}
private void btnAdd_Click(object sender, EventArgs e)
{
if (logicalControl() == false)
return;
Insertproduct(txtproductcode.Text, cmbBrand.Text, txtproductamount.Text, txtproductprice.Text, grupBox.Text);
txtproductcode.Text = "";
cmbBrand.Text = "";
txtproductamount.Text = "";
txtproductprice.Text = "";
grupBox.Text = "";
MessageBox.Show("Product Details Saved", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
In this form I have three text box which will take the values only integer.they are
txtproductamount.Text = "";
txtproductprice
grupBox
txtproductamount
I want to control if user enter anything exept Integer it will show error. because they are saved in my database as integer.
please help me if possible.
Thank you
Kamrul Ahsan
Istanbul,Turkey
|
|
|
|
|
You can check it in the keypress event of textboxes and suppress it by setting e.Handled property to true.
|
|
|
|
|
Thank you so much
Kamrul Ahsan
ITU,
Turkey.
|
|
|
|