|
|
You have to define what you expect to happen, you change it all the time. You started off with merging single characters, and now you want to separate words by inserting extra spaces also...
For example, how should the delimiters work? Should a space be added after each delimiter, and should that happen all the time or only if there is a single character after it? Does it matter if that single character will be merged with another single character? If there is a single character before a delimiter, should a space be added, and should that happen only if there is another single character to merge it with?
Also, why do you expect the last character in your example to remain a single character eventhough there is another single character before it to merge it with?
Perhaps you should explain what it is that you are actually going to use it for, instead of making up abstract examples.
Regular expressions can be used to a lot of things, but guessing is not one of them...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
if a delimter is before or after a single character it also should be merged together.. that's.....
other things i fixed ...
pls send me links regading regular expression symbols...
the quieter u become more u hear
|
|
|
|
|
kindly send me any good link to study about patterning Regex.... what's the meaning for each characters used in that.. so and so... only i need these informations...
general Regex functions and operations i know....
thanks
the quieter u become more u hear
|
|
|
|
|
Hi Expert,
i m new in C#
this is login form.but connection adapter having null value.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace ExampleOne
{
public partial class login : Form
{
public MySqlDataAdapter da;
public DataSet adset;
public string g_login;
public login()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void btnlogin_Click(object sender, EventArgs e)
{
string g_login = this.tbUsername.Text;
string g_password = this.tbpassword.Text;
string MyConString = "server=localhost;database=password;uid=root;password=asd";
MySqlConnection connection = new MySqlConnection(MyConString);
string Strsql = "select * from tablogin where ='"+g_login ;
try
{
connection.Open();
MySqlDataAdapter DA = new MySqlDataAdapter(Strsql, connection);
MySqlCommandBuilder cmdb = new MySqlCommandBuilder(da);
DA.Fill(adset, "tablogin");
DataColumn[] key = new DataColumn[1];
key[0] = adset.Tables["tablogin"].Columns["password"];
adset.Tables["tablogin"].PrimaryKey = key;
DataRow dr = adset.Tables["tablogin"].Rows.Find(g_password);
if ((g_login == dr["userid"].ToString()) && (g_password == dr["password"].ToString()))
{
MessageBox.Show("You are logged in!","welcome",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
MessageBox.Show("You entered wrong Username or Password","Warning",MessageBoxButtons.OKCancel,MessageBoxIcon.Warning);
}
}
catch (Exception ex)
{
Console.WriteLine("Error Conecting to database", "window information" + ex.Message.ToString(),
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void Close_Click(object sender, EventArgs e)
{
DialogResult dr = MessageBox.Show("Are you sure to Exit ?","finish" ,MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr == DialogResult.Yes)
{
Application.Exit();
}
}
}
}
|
|
|
|
|
i've got a font wich is mentioned true type.when i tried to set this font to combobox i get the error saying this is not a true type font . how can i set this font to the cmbbox.do i have any solution .intead of going to some other font .
|
|
|
|
|
Can someone please guide me in finding a working solution of reading a .mpp file in C#, I have a sample .mpp file from MS Project 2003, i don't have MS Project application installed, so i am not able to find the OLEDB drivers 9.0,11.0 or anything like that to download or install on my PC, kindly help...
would just like to mention that i have already have gone through a lot of articles and sample, but they all seem to have the dll, which possibly means that the application would be installed which is not the case here... help needed asap
|
|
|
|
|
Hey everbody
I have a big problem to upload one csv fil to mysql database.
i have a big csv file with many records and column
Eks.:
ArticleNo ManArticleNo DescShort DescLong Manufacturer Price Stock
642 0993A001 BJ-642/black 790sh f BJ300 330 Canon blækpatron, sort (BJI-642BK) Canon 97,11 0
665 1009A001 BJC-643/black f BJC-800 820 880 Canon blækpatron, sort (BJI-643BK) Canon 157,43 0
673 1012A001 BJC-643/yellow f BJC-800 820 880 Canon blækpatron, gul (BJI-643Y) Canon 203,42 0
3131 51604A HP Ink Cart/Black f ThJet QJet+ f plain HP blækpatron, sort (CJ-3A) Hewlett Packard 57,91 115
3135 51605R HP Ink cart/red f Think- Quietjet HP blækpatron til ThinkJet/QuietJet, magenta Hewlett Packard 63,63 0
i load the file like this
StreamReader input = new StreamReader(@"c:\test.csv");
string inputLine = "";
while ((inputLine = input.ReadLine()) != null)
{
but now i need just to take ManArticleNo and Price from the inputLine
my input line has all the row, how can i split or somthing to take just that column i need ?
string tr = inputLine.?(?);
}
input.Close();
|
|
|
|
|
string[] columns = inputLine.Split(',');
then you just reference the index of the columns you want e.g.
string ManArticleNo = columns[0];
then you do the database update stuff
My opinion is... If someone has already posted an answer, dont post the SAME answer
|
|
|
|
|
you are the man
|
|
|
|
|
hi,
I have created Excel-RTD server in C#. like this article
http://weblogs.asp.net/kennykerr/archive/2008/11/13/Rtd3.aspx[^]
Here data is populating randomly in excel file.
I will start RTD Server from different project (like button clik) :- able to start successfully
and i want to send/update data to rtd server from other project. :- object used by RTD sever has no value, it is worked altogether in different thread.
Thanks
hiren shah
hirenkshah@gmail.com
|
|
|
|
|
That's great.
Regards,
Rob Philpott.
|
|
|
|
|
Hi,
I have a data grid control and I placed one combo box in that data grid and I am binding data to data grid combo box.When i run the application by default the combo box is not showing anything if i double click on combo box then only it is displaying the items. Can anybody please help me to resolve the problem showing combo box items in data grid control by default when i run the application.
Thanks in Advance
Pavani
|
|
|
|
|
Hi, I want to give a value in a textbox when the 'tab' key is pressed in another textbox. My code is this:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ( (e.KeyChar.Equals(('\t'))) || (e.KeyChar.Equals(Keys.Tab)) ){
this.textBox2.Text = "hola";
}
}
But the only way that it works is to set the 'Multiline' and 'AcceptsTab' properties to be true (both properties at the same time, unless it not works). And the problem is that on this way, to press the tab key the focus not change to another textbox.
Anybody knows a better way?
|
|
|
|
|
Why not use the Leave or Validated event for this ?
|
|
|
|
|
It is a good alternative. I can use the keyPress event for the intro key, and the Leave event for the tab key.
Ok, thanks
|
|
|
|
|
2869 is the error code which is shown while installing the service setup .The service is working good in XP.
is there any thing which i should add while creating service to run in vista
|
|
|
|
|
dont know the error code but when i had a vista issue, it was to do with the project manifest, maybe you could look at that. Its to do with trusting the application or something
My opinion is... If someone has already posted an answer, dont post the SAME answer
|
|
|
|
|
thanks
but what is this project manifest
|
|
|
|
|
something to do with security, somes vista apps seem to want it to run. Its somesort of xml coded file that determines how the application should run, i.e. as administrator or user etc.
I cant remember in detail have a look at this or search c# manifest or something
http://support.microsoft.com/kb/944276[^]
My opinion is... If someone has already posted an answer, dont post the SAME answer
|
|
|
|
|
Hi CP,
I am desiging a custom control combobox that looks like combobox at design time in VS 2005 .
I am left with one thing. I dont want to use dropdownstyle but i want the user cannot write any text at runtime in the combobox. i suppressed the combobox & removed the caret.'
ReQ : i want the user cannot write anything in the combobox if the caret is not preset also.
Regards
vb8.0
|
|
|
|
|
Sonds like a disaster. Why have a combobox at all ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Graus ,
Thanks for responding.This is for the end user.
I am creating a custom ComboBox which doesnt accept the caret , text and doesn't show the list .
Now i required is how to hide the focus when the cursor is on the combobox button to show as disable.
1 ) how to hide the focus when the cursor is on the combobox button at runtime ?
Any ideas ?
Any views regarding this ?
Regards,
VB 8.0
|
|
|
|
|
VB 8.0 wrote: a custom ComboBox which doesnt accept the caret , text and doesn't show the list .
You mean a 'Label'???
My opinion is... If someone has already posted an answer, dont post the SAME answer
|
|
|
|
|
Why on earth would you want to design a combobox with no dropdown?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|