|
Well i'm trying to avoid using an RTFBox. It has some handy functions, but i'm really trying to focus on using this control without being dependant on the RTFBox.
I might just need to find a much more efficient way to process the highlighted words in a string of text.
|
|
|
|
|
when I create a text editor, I use a Panel and draw everything myself. Syntax coloring means looking for keywords and some delimiters and using some colors. For an IDE, texts are line oriented, so things are pretty much local; and the big trick is to only compute lines that are visible, which is say 50 lines out of a file that could span hundreds or thousands of lines.
If you want more specific help, you'll have to provide some concrete information; so far you have been very vague!
FYI: I avoid Regex when performance is important; IMO most of the time Regex offers comfort at the expense of speed.
|
|
|
|
|
I have created tables in SQL Server Management Studio which I want to use in a program I have in VS 2010. When you check the properties of the tables in Management Studio there doesn't appear to be an actual path that you can use as a connection string. Can anybody help me with this?
Thanks
Darrall
|
|
|
|
|
http://www.connectionstrings.com/[^]
You already have SSMS open and connected to a database and you can't figure out a connection string to use?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
A fair enough observation except that it doesn't want the path to the database itself...it wants the path to the file that I created within the database and that path I can't find.
|
|
|
|
|
Darrall wrote: the path to the file that I created within the database
I have no idea what you're talking about
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I find that hard to believe. Are you sure it's not Access?
|
|
|
|
|
For an SQL Server connection string, you specify the database name, not the path to the database file. The sole exception to that would be if you were using SQL Server Express.
|
|
|
|
|
Thanks Dave. This is the sole exception. I am using SQL Server Express 2008.
|
|
|
|
|
I have Form1
form1 have 2 textbox & 1 button
I cLICK bUTTON 1 tHEN SHOW fORM2
form2 have ONE datagrid
i Want when Click IN row then Cell[0] transfer to Text BOX in form1
how i can?
|
|
|
|
|
Set up an event in form2 that form1 subscribes to. Either pass the data via a custom EventArgs with the event, or via a property on form2.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
The principal is demonstrated here[^], just adapt it to suit your situation.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
how to access the "format object" in crystal report in coding!
i wanna to change the font of parameter of crystal reports dynamically or at runtime !
and good solution !?
Something like :
repPreview1.ParameterFields["Name"].Font= ...
|
|
|
|
|
I am seeking a way to Convert pixels to Twips ?
any good solution.
I have searched google but no used ans i get!
|
|
|
|
|
If you Bingle pixels to twips you will find loads of examples.
If you have done so and are unable convert the examples to C#, that is another matter.
Ask for help on the specific problems you are having and someone may be able to help you.
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.”
|
|
|
|
|
Henry Minute wrote: Bingle
That's a new term, but doesn't have the verb/noun impact as Google
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You stand corrected.
Gingle not Bingle is the new term. It has the impact!
|
|
|
|
|
This[^] suggests all it takes is multiplying by 14.40
|
|
|
|
|
Hello,
I am developing a GMAO csharp smart device application.I am in the step of creating a checklist using checkbox tool added dynamically:
I have two tables:Travaux (Works in English) and Actions related by the two fields Nature (table Travaux)and typeTravail(Table Actions).If the user enters the number of the work(NBT the pk_Travaux),the system adds a number of checkboxs equal to the steps that should the user follows to accomplish(field step in Actions table).After that,the user has the possibility to check or not the step if he did it.All the traitments will be done dynamically with the database
My select statement is:
select Etape from Action where ((Travaux.NBT=textbox1.text) and (Travaux.Nature=Action.TypeTravail))
Equal of what this select returns,it will add dynamically checkboxs
I tried with this code but not working due to some errors
private void button1_Click(object sender, EventArgs e)
{
string wCS = @"Data Source =\Storage Card\ModeDifféré\BaseGmaoLocale.sdf;";
SqlCeConnection sqlceconn = new SqlCeConnection(wCS);
SqlCeCommand command = sqlceconn.CreateCommand();
command.CommandText = "Select NBT, Nature from Travaux where NBT=@NBT ";
string s1 = textBox1.Text;
SqlCeParameter NBT = new SqlCeParameter("@NBT", SqlDbType.NVarChar);
NBT.Value = s1;
command.Parameters.Add(NBT);
SqlCeDataAdapter adapter = new SqlCeDataAdapter(command);
DataSet ds = new DataSet();
try
{
adapter.Fill(ds, "SQL Temp Table");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
foreach (DataRow da in adapter)
{ string s = adapter["Nature"]; }
if ((ds.Tables.Count > 0) && (ds.Tables["SQL Temp Table"] != null))
{
MessageBox.Show("Number of row(s) - " + ds.Tables["SQL Temp Table"].Rows.Count);
if (ds.Tables["SQL Temp Table"].Rows.Count > 0)
{
MessageBox.Show("Numéro de BT trouvé");
SqlCeCommand command1 = sqlceconn.CreateCommand();
command1.CommandText = "Select NoEtape, Etape from Travaux where TypeTravail=@typ ";
string s2 = textBox1.Text;
SqlCeParameter Typ = new SqlCeParameter("@Typ", SqlDbType.NVarChar);
Typ.Value = s2;
command1.Parameters.Add(Typ);
SqlCeDataAdapter adapt = new SqlCeDataAdapter(command1);
DataSet dat = new DataSet();
try
{
adapt.Fill(dat, "SQL Temp Table");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
foreach (DataRow ligne in adapt.)
{
System.Console.WriteLine(adapt[0]);
}
}
else MessageBox.Show("Veuillez saisir un autre NBT");
}
adapter.Dispose();
sqlceconn.Dispose();
command.Dispose();
}
The errors are :
Error 1 foreach statement cannot operate on variables of type 'System.Data.SqlServerCe.SqlCeDataAdapter' because 'System.Data.SqlServerCe.SqlCeDataAdapter' does not contain a public definition for 'GetEnumerator' C:\Users\Admin\Documents\Visual Studio 2008\Projects\GMAOMobile\ModeDifféré\Travail.cs
Error 2 Cannot apply indexing with [] to an expression of type 'System.Data.SqlServerCe.SqlCeDataAdapter' C:\Users\Admin\Documents\Visual Studio 2008\Projects\GMAOMobile\ModeDifféré\Travail.cs
Error 3 foreach statement cannot operate on variables of type 'System.Data.SqlServerCe.SqlCeDataAdapter' because 'System.Data.SqlServerCe.SqlCeDataAdapter' does not contain a public definition for 'GetEnumerator' C:\Users\Admin\Documents\Visual Studio 2008\Projects\GMAOMobile\ModeDifféré\Travail.cs
Error 4 Cannot apply indexing with [] to an expression of type 'System.Data.SqlServerCe.SqlCeDataAdapter' C:\Users\Admin\Documents\Visual Studio 2008\Projects\GMAOMobile\ModeDifféré\Travail.cs
I wait for u help
Thanks
|
|
|
|
|
Tunisien86 wrote: foreach (DataRow da in adapter) { string s = adapter["Nature"]; }
Should be
foreach (DataRow da in ds.Tables[0].Rows)
{
string s = da["Nature"];
}
Tunisien86 wrote: foreach (DataRow ligne in adapt.) { System.Console.WriteLine(adapt[0]); }
This should be
foreach (DataRow dataRow in dat.Tables[0].Rows)
{
System.Console.WriteLine(dataRow[0]);
}
|
|
|
|
|
Hi,
Thanks Reddy,the errors disappears all with some corrections:
foreach (DataRow da in ds.Tables[0].Rows)
{
string s = da[0].ToString();}
.I want now to add every row it found after executing the select request:
command1.CommandText = "Select NoEtape, Etape from Action where TypeTravail=@typ ";
I create a listview and I wanna add like items every result of the select.I modify my code in his end like this:
............
foreach (DataRow dataRow in dat.Tables[0].Rows)
{
ListViewItem item = new ListViewItem();
item.Text = dataRow[0].ToString();
listView1.Items.Add(item);
System.Console.WriteLine(dataRow[0]);
}
}
else MessageBox.Show("Veuillez saisir un autre NBT");
}
adapter.Dispose();
sqlceconn.Dispose();
command.Dispose();
}
}
But this modification doesn't show any thing in the listviewitem.
Thanks a lot for u suggestions
|
|
|
|
|
Tunisien86 wrote: dat.Tables[0].Rows
Did you check if the DataTable has any rows after executing the select statement? Does it even get into the foreach loop?
|
|
|
|
|
Hi,
Thank u for u help.I found the solution using the listview tool(with its option checked) and all gets well.This is the link after that solved my issue:
http://msdn.microsoft.com/en-us/library/ms229643.aspx[^]
Thanks a lot and can u have a look to my new thread:DataGridView-DataBase in csharp smart device posted a few minutes ago
Thanks
|
|
|
|
|
Hi, I have the following string "455.56"
I want this to format in: 00455.5600.
I tried this and was expecting it to work fine: string strLong = String.Format(CultureInfo.InvariantCulture, "{0:00000.0000}", "455.66");
This statement results in: "455.66"!!
Why doesn't this work as expected? Other solutions?
thanks for your time.
Regards,
Jan
|
|
|
|
|
Try feeding it a number rather than a string...
string strLong = String.Format(CultureInfo.InvariantCulture, "{0:00000.0000}", 455.66);
The format info :00000.0000 is for numeric formats only: MSDN String.Format formats[^]
[edit]Should have explained the format is numeric... Oops![/edit]
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|