|
Okay, and what is the error your receiving?
Do you really want the concatenated string to look like this (if txtrate=theRating, txtweight=theWeight)?
theRating'&&'theWeight
Or do you want:
theRating&&theWeight
Check the part where you put your strings together.
If you want to use a ' in your concatenated string you have to use double '' like this:
string query = "insert into Data(Product,discription) values('" + textBox1.Text + "','" + textBox2.Text + "''&& ''" + textBox3.Text + "')"; modified on Friday, March 12, 2010 7:01 AM
|
|
|
|
|
I have Done
Thanks For Help Me Sir
|
|
|
|
|
You're welcome
|
|
|
|
|
I am developing some engineering software. It is going quite well and I want to implement network licencing as the copyright protection system for my program. this seems to be the standard for software in my industry basically I believe it works by giving the server a fixed number of licences and it dishes them out to users as required. A popular drafting program, autocad, works like this.
My problem is that I have no idea how to implement this in my program. I am not experianced with dealing with servers and cannot find any example code to work with. I have found code that implements licenceing by handing out a key with the software but it isn't as secure as I would like.
Can anyone help me out with some open source software? Would also be interested in commercial software.
Thanks
|
|
|
|
|
|
thanks very much for the links. I will have a look.
|
|
|
|
|
Hi everyone,
Had a doubt.
I could send the mail using exchange server with ease.
But my boss wants me to send the mails using localhost itself.
But wen i send with local host it delivers only to my gmail account.
No yahoo, not even my own machine outlook it doesnt reach.
Can u suggest any help.
i have pasted my code below.
I am using a windows form application.
Code:
MailMessage message = new MailMessage(
txtsendfrom.Text,
txtsendto.Text,
txtsubject.Text,
txtmessage.Text);
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("localhost");
smtp.Send(message);
MessageBox.Show( "Message sent to " + txtsendto.Text + " at " + DateTime.Now.ToString() + ".","Success ");
The program executes successfully but wont deliver...
Please help....
Thanks in advance
Puneeth
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:35am.
|
|
|
|
|
But to gmail it delivers dude....
|
|
|
|
|
If it only delivers to your GMail account what is the value of txtsendto.Text ?
Remember that some email servers are configured to only accept emails from email servers that are on a valid domain, reverse DNS based on IP, as such your work exchange sever may not accept your localhost as a valid email server to accept emails from.
|
|
|
|
|
ya tats true bro.....
Sometimes it tells me tat the IP is in DNS Blacklist list...So it cannot deliver.
But wat to do for tat.
Any solution to make my domain valid ????
Thanks. tat was a good suggestion.
txtsendto.Text ll have the mail id to be delivered to.
|
|
|
|
|
If your talking about your work exchange sever you will need to get the sys admin to put in an exception to accept your IP address as a vaild address to receive emails from, if they will not do that there isn't much you can really do, unless you can access say your ISPs email server but then you may need to supply credentials.
If this is really causing you issues you need to explain to your boss that you can't properly test using localhost as it is not a valid email server for other email servers to receive emails from.
|
|
|
|
|
Thanks a lot bro....
That was really very helpful.
I ll do that immediately.
Once again thanks a lot
|
|
|
|
|
hi all
i am facing a problem with the microsoft automation program i am trying to make
i am using visual studio.net 2008 c# application form with microsoft 2003 office EXCEL
i am using the following codes:
objapp = new Excel.Application
Excel.Workbook wb = objapp.Workbooks_open(path,system.reflection.missing.Value
,system.reflection.missing.Value
,system.reflection.missing.Value
,system.reflection.missing.Value
,system.reflection.missing.Value
,system.reflection.missing.Value
,system.reflection.missing.Value
,system.reflection.missing.Value
,system.reflection.missing.Value
,system.reflection.missing.Value
,system.reflection.missing.Value
,system.reflection.missing.Value)
Excel.Worksheet ws1 = (Excel.Worksheet)wb.Worksheets[1];
EDITING of cells data
wb.close(true,Type.missing,Type.missing);
objapp.application.quit();
however it seem that the file is always opening in readonly and after editing the data i am having trouble saving the edited file back into the same file which i open from.
also i realize that after changing a cell data. the cell data does not update immediately.
and lastly the process called EXCEL wont end even after i shot the program until i go task manager and end it manually
|
|
|
|
|
Hi,
I've never done such things, however this[^] suggests one of the parameters is called readOnly, so passing it missing may not be a good idea.
|
|
|
|
|
neodeaths wrote: i am having trouble saving the edited file back into the same file which i open from.
There's a Save[^] method in the _Workbook interface that should help.
DybsThe shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Hello everyone, I know i have asked this before, but i still cant figure it out and i will end up cracking up!
OK,
string input = ("34545-87632-09087-34544-98766-00989-34323-89887-32");
The above string is a 41-digit decimal number entered into a text box by the user.
now how do i do the following...?
A decimal number of this length roughly corresponds to a 136-bit binary
number. In fact, the 41-digit number is just the decimal encoding of
such a 136-bit multi-precision integer, which is stored in little
endian byte order as a byte array. Hence, the above Installation ID
can also be represented as a sequence of 17 bytes as in
0xXX 0xXX 0xXX 0xXX 0xXX 0xXX 0xXX 0xXX
0x94 0xAA 0x46 0xD6 0x0F 0xBD 0x2C 0xC8
0x00
So, how do i get the 41 digit string into its 17 byte array, however...
1) Not just a byte representation, where i end up with 41 bytes.
2) I know it involves binary or bit math, but i havent got a clue
Could someone please show me how to encode and decode as above, and i will be eternaly gratefull.
Thank you
Steve
|
|
|
|
|
I'm not sure exactly what you're trying to do, but have you thought of using string.Split on the '-' char to get the 9 substrings? Once you have those, then you can int.Parse to turn each of them into numbers.
If you just need to have the correct numbers, that's it. If you need it turned back into an ASCII string with hex digits, then just format each int to hexadecimal and concatenate or whatever else you want to do.
Hope that helped. If not, perhaps someone else will have a better idea.CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Hi Walt,
What he has is a VERY big number as a string eg "345487630908345498760098343289883" and needs this in its binary form, as the number is to big for either an int or long he needs to manually turn it into a byte[] which is 17 bytes in length.
|
|
|
|
|
Here[^] is a link on how to do binary math, have a look at the Decimal Conversion section and see if you can use this to figure out what you need to do.
Here, now try to do the reverse yourself;
string originalNumberString = "3454587632090873454498766009893432389887";
char[] numberValues = originalNumberString.ToCharArray();
int numberLength = numberValues.Length;
int originalLength = numberValues.Length;
string binaryNumber = string.Empty;
do
{
char[] newNumberString = new char[numberLength];
double remainderValue = 0.00;
foreach (char numberValue in numberValues)
{
double valueNumber = (double.Parse(numberValue.ToString()) / 2) + remainderValue;
remainderValue = (valueNumber % 1) * 10;
newNumberString[originalLength - numberLength] = (valueNumber - (valueNumber % 1)).ToString().ToCharArray()[0];
--numberLength;
}
binaryNumber += (remainderValue > 0 ? 1 : 0);
int offSetValue = (newNumberString[0] == '0' ? 1 : 0);
numberValues = new char[numberValues.Length - offSetValue];
Array.Copy(newNumberString, offSetValue, numberValues, 0, numberValues.Length);
numberLength = numberValues.Length;
originalLength = numberValues.Length;
} while (originalLength > 0);
while (((binaryNumber.Length / 8.0) % 1) > 0)
{
binaryNumber += "0";
}
char[] charArray = binaryNumber.ToCharArray();
Array.Reverse(charArray);
binaryNumber = new string(charArray);
byte[] numberArray = new byte[binaryNumber.Length / 8];
System.Collections.BitArray bitArray = new System.Collections.BitArray(binaryNumber.Length);
for (int bitIndex = 0; bitIndex < binaryNumber.Length; ++bitIndex)
{
bitArray[bitIndex] = (binaryNumber[bitIndex] == '1' ? true : false);
}
bitArray.CopyTo(numberArray, 0);
This will give you a 17 byte array or a 136 bit BitArray for a 41 digit number.modified on Friday, March 12, 2010 2:15 AM
|
|
|
|
|
There's a BigInteger class here on CP:
C# BigInteger Class[^].45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
modified on Friday, March 12, 2010 8:18 AM
|
|
|
|
|
This is his 5th time asking this question, though it is just from a spec on windows WPA Activation, he has been pointed to a big int class before so I thought I would give him some code that would do exactly what he wanted.
|
|
|
|
|
my main form is form1.
<br />
<br />
private void newToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
newToolStripMenuItem.Enabled = false;<br />
<br />
Form2 frm2 = new Form2();<br />
frm2.Owner = this;<br />
frm2.Show();<br />
<br />
<br />
how can i enable back newToolStripMenuItem to true if the form2 to is closed i tried to create if form2 close event but
i can't get the intelisense of newToolStripMenuItem
|
|
|
|
|
Subscribe to the FormClosed event of frm2 and enable the menu item.
private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
newToolStripMenuItem.Enabled = false;
Form2 frm2 = new Form2();
frm2.Owner = this;
frm2.FormClosed += new FormClosedEventHandler(frm2_FormClosed);
frm2.Show();
}
private void frm2_FormClosed(object sender, FormClosedEventArgs e)
{
newToolStripMenuItem.Enabled = true;
} Dave
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
i cant get the intelisense of newToolStripMenuItem.Enabled = true;
in the event private void frm2_FormClosed(object sender, FormClosedEventArgs e)
my newToolStripMenuItem is in my form1 and i want to show the form2 but disable the newToolStripMenuItem if form2 is loade already. and if form2 is close then the newToolStripMenuItem is enabled
|
|
|
|