|
leelaraj wrote: CDate isnot a recognised function name
Use: cast(x as datetime)
leelaraj wrote: how to cnvert Mod 60 in to sql server
Use: % 60
---
b { font-weight: normal; }
|
|
|
|
|
Thank you very much...its working fine.
|
|
|
|
|
Please help me solve this problem:
I wanna run an application with parameters, when i use these commands, the program doesn't work.
<br />
<br />
System.Diagnostics.Process p = new System.Diagnostics.Process();<br />
p.StartInfo.Filename = "gSpan.exe 10 set2.gsp out2_1";<br />
p.Start();<br />
<br />
"gSpan.exe" is a program coded by VB6.0
"10 set2.gsp out2_1" are 3 parameters that gSpan.exe needs.
Thanks much
-- modified at 23:17 Tuesday 20th June, 2006
|
|
|
|
|
Use the Arguments property of the StartInfo, or put the filename and arguments in the call to the Start method.
---
b { font-weight: normal; }
-- modified at 0:43 Wednesday 21st June, 2006
|
|
|
|
|
hi there,
Im a student from singapore...i happened to find this website and found the articles to be very interesting and informative.However im now assigned a C# windows application proj and i have some questions on it as i have no programming background.Would anyone be able to help me?maybe u can send me some resources or similar source code regarding : using VS 2003 or 2005 to create a windows application whereby i am access to modify,add,delete,sort and filter a database in Excel format... thanks in advance
|
|
|
|
|
Microsoft is a good source of information of "how to" develop Microsoft Windows applications that automate Microsoft products using Microsoft development tools. http://support.microsoft.com/?kbid=306023[^]
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
hi thanks for the help..but i think u have misunderstood me.. the link u gave was for transferring data from the windows application to excel format but it is not what i want.. i need something to do with SQL to link my EXCEL DATABASE TO the windows application.. any guidance is deeply appreciated
|
|
|
|
|
skyeddie wrote: my EXCEL DATABASE
If you are referring to "Microsoft Excel" then the link I provided gives you exactly what you asked for. If it is NOT Microsoft Excel then I don't know what it is and you need to provide an URL to the Database products web site.
|
|
|
|
|
hi thanks for the help..but i think u have misunderstood me.. the link u gave was for transferring data from the windows application to excel format but it is not what i want.. i need something to do with SQL to link my EXCEL DATABASE TO the windows application.. any guidance is deeply appreciated
|
|
|
|
|
you can follow following:
1.use the wizard tool.microsoft VS.net 2003 SDK can automatic create code.
2.use the MSDN.MSDN is a strong tool,you can search everything you don't know.
3.just purchase book to read!
KSCsoft
|
|
|
|
|
Hello i have a control that inherits the list view i have tried to override the OnPaint and OnPaintBackground events but the code never seems to reach either function why would my overriden functions not be called when the control paints itself?
|
|
|
|
|
Did you set ControlStyles.UserPaint?
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
This is the error I get when I try to update.
******************************************************************************
The query processor could not produce a query plan from the optimizer because a query cannot update a text, ntext, or image column and a clustering key at the same time.
******************************************************************************
Sample code that causes this error.
private void button1_Click(object sender, EventArgs e)
{
this.Validate();
this.tb.EndEdit();
this.tb.Update(this.DataSet.tb);
}
Form was created by using the drag and drop abilities of the data source. simple form, only 4 items in the table.
|
|
|
|
|
Has anyone ever seen this? Or am I the winner of finding new ways to break code for the day? :->
|
|
|
|
|
Hello,
Can you please tell me how can I format a richTextBox using bbcode!
How can I search in the whole richTextBox content and put every
occurance of text between [ b ] & [ /b ] in bold.
Bla Bla Bla Bla Bla Bla [ b ]IN BOLD1[ /b ] Bla Bla Bla Bla Bla Bla [ b
]IN BOLD2[ /b ] Bla [ i ]ITALIC[ /i ]
Your help would be greatly appreciated.
|
|
|
|
|
Well, if I understand correctly what you're trying to do should be as easy as parsing the text in the richTextBox control and looking for the <b> and <i> tags. The easiest (not the most efficient) way to do this is to do a two-pass parse of the text. First for the BOLD tags and second for the ITALIC text.
Whenever you run into an open BOLD tag, increment boldCount variable and store the position. Then remove the tag from the text. Whenever you run into a close BOLD tag, decrement boldCount, and remove the colsing tag from the text. When boldCount = 0, select the text starting at the recorded position and then set it's bold property to TRUE. Keep going until the end of the text.
Repeat for the ITALIC tags.
Here is an example that does bold tags. Modifying this code to do italic text is trivial so it wasn't included here.. Hope this helps and don't forget to visit digitalGetto
private void ParseBoldText(RichTextBox tb)
{
int boldCount = 0;
int lastBoldStartPosition = 0;
int currentPosition = 0;
while (currentPosition < tb.Text.Length - 3)
{
if (tb.Text.Substring(currentPosition, 3) == "<b>")
{
if(boldCount == 0)
lastBoldStartPosition = currentPosition;
boldCount++;
}
if (tb.Text.Substring(currentPosition, 4) == "</b>")
{
boldCount--;
if (boldCount == 0)
{
tb.Select(lastBoldStartPosition + 3, currentPosition - lastBoldStartPosition - 3);
tb.SelectionFont = new Font(tb.SelectionFont.FontFamily, tb.SelectionFont.Size, tb.SelectionFont.Style | FontStyle.Bold);
}
}
currentPosition += 1;
}
tb.Rtf = tb.Rtf.Replace("<b>", "");
tb.Rtf = tb.Rtf.Replace("</b>", "");
}
----
www.digitalGetto.com
-- modified at 18:07 Tuesday 20th June, 2006
|
|
|
|
|
Thanks but this is not working:
tb.Rtf = tb.Rtf.Replace("[b]", "");<br />
tb.Rtf = tb.Rtf.Replace("[/b]", "");
I still have all the tags shown.
-- modified at 19:28 Tuesday 20th June, 2006
|
|
|
|
|
Also you said: the easiest (not the most efficient)
Can you give me an idea about the most efficient way?
|
|
|
|
|
Well, when I said the method was not the most efficient I meant that for large texts it will most likely be rather slow. Depending on your needs you may or may not want to put in the extra effort to look for/implement more efficient algorithms.
The performance hit of the method shown is due to the fact that it reads each character in the text. That is time consuming. A first optimization is to combine looking for BOLD tags with looking for ITALIC tags. That is, to use the same loop to do both. That way, you cut the time approximately in half. Another option you may consider is using unsafe code (pointers) to loop through the text. Yet another possibility is to use regular expressions to perform the search and replace.
As far as the other problem goes (the code not replacing the tags), that is rather strange. I've tested the code before posting it here and it worked. Can you give me more details as to how it fails?!
----
www.digitalGetto.com
|
|
|
|
|
Hi...I'm just a newby in C# programming. really need help bout an application i'm doing. I would like to change the file extensions of certain files regarding data encryption. But what i also want to do is, how will I associate my customized files with a special icon that I would put into my project in visual studio 2005? Anybody pls. help....
kirkangel
|
|
|
|
|
You typically do this with a setup project. In Visual Studio, you can add a Setup Project to your solution. Inside the setup project, you can go into the File Association editor and setup a custom association between a file extension and your app. IIRC, you can set an icon for the association as well.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Goof around music jam with my brothers (with video)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Tnx a lot... you've been very helpfull...! God bless!
|
|
|
|
|
I created a windows form in VS2005 that uses Enterprise Library - DAAB - version Jan 2006 to access the DB in its constructor. Everything works fine; however, when I created a UserControl that attempts to store that form as a variable, the VS 2005 designer will not let me drag that UserControl onto a new form. It gives me the following error:
“Failed to create component ‘UserControl’. The error message follows: ‘System.NullReferenceException: Object reference not set to an instance of object. At Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.get_DefaultName(), at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseMapper.MapName(String name, IConfigurationSource configSource)…….”
Everything compiles successfully without errors; however, I am unable to use the UserControl on any forms. After debugging, I found that the error is caused by the line “Database db = DatabaseFactory.CreateDatabase();” This line is standard DAAB code and is supposed to work and it does works in all cases I’ve run across EXCEPT this.
Is this a bug in the DAAB, or VS Designer, or am I missing something? Any help will be appreciated! Thanks in advance!
Below is the relevant code:
public partial class SampleControl : UserControl
{
private ProductForm subForm = new ProductForm();
public SampleControl ()
{
InitializeComponent();
}
}
public partial class ProductForm : Form
{
public ProductForm()
{
InitializeComponent();
AccessDB();
}
private void AccessDB()
{
//THIS LINE CAUSES THE DESIGNER ERROR
Database db = DatabaseFactory.CreateDatabase();
}
}
Thanks for any help
|
|
|
|
|
Could be a bug in the designer. If it's not necessary to create a database instance in the ocntrol's designer, you can modify your code so it doesn't get loaded in design mode:
public ProductForm()
{
InitializeComponent();
if(!this.DesignMode)
{
AccessDB();
}
}
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Goof around music jam with my brothers (with video)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hi,first you must know runtime and design time,
When you drag a control to your design panel in vs,
this is design time, in constructor you want to
initialize some thing, like Database db = DatabaseFactory.CreateDatabase(); but may be this operation need read some
information and this must be in Runtime not in designtime
so you will get an error.
You can have a try, not in VS design enviournment,
but in Run time to create your control or forms
may this help you
|
|
|
|