|
Hello
My problem is that i want to save (convert) my projects each form in dll format. I'm working on windows forms. I know how we can create dll custom controls.
For this I create new Custom Control Project and add my existing form to it and then i compile that, about referencing another forms that not available in this project that shows errors.
Is another way to make DLL files from project forms to keep their structure hidden.
Thanks.
|
|
|
|
|
If your forms rely on each other at all, this is going to get messy. You want to put each form into a dll ? Sounds like a nightmare to me.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
create the new empty forms,copy code from the old forms you need!
KSCsoft
|
|
|
|
|
Hi,
I'm creating log file(Notepad) for my application which includes Category,Date Time, Source Line, Message as a column. I need to have each as column and when i export it to Excel it should accomdate in individual column. How can i accomplish this.
|
|
|
|
|
I think , first you can import this to datagrid and there are lots of articles which can help you to export to excel ..
following is the code snippet that may solve your problem
step 1 include this class to read read the value from text file
public class TextToDataSet
{
public TextToDataSet()
{
}
public static DataSet Convert(string File,
string TableName, string delimiter)
{
DataSet result = new DataSet();
StreamReader s = new StreamReader(File);
string[] columns = s.ReadLine().Split(delimiter.ToCharArray());
result.Tables.Add(TableName);
foreach(string col in columns)
{
bool added = false;
string next = "";
int i = 0;
while(!added)
{
string columnname = col + next;
columnname = columnname.Replace("#","");
columnname = columnname.Replace("'","");
columnname = columnname.Replace("&","");
if(!result.Tables[TableName].Columns.Contains(columnname))
{
result.Tables[TableName].Columns.Add(columnname);
added = true;
}
else
{
i++;
next = "_" + i.ToString();
}
}
}
string AllData = s.ReadToEnd();
string[] rows = AllData.Split("\r\n".ToCharArray());
foreach(string r in rows)
{
string[] items = r.Split(delimiter.ToCharArray());
result.Tables[TableName].Rows.Add(items);
}
return result;
}
}
step 2
fill the contents of the text file to the dataset using following syntax
DataSet dsupdate = TextToDataSet.Convert(System.Web.HttpContext.Current.Server.MapPath("./LogFiles/ErrLog.txt"),"errorhandlerlog","$");
here convert is the static method of the class
Now 50 % of work is over you can either bind the dataset to the datagrid and refer other articles on code project which are on exporting dataset to excel or datagrid to excel . Exporting the text file directly to excel may not help when you want to debug or in case of some unknown error.
Hope this give you litte comfort for your problem
|
|
|
|
|
Hi
iam having a problem in coverting ms acess query to sql query,plz help me if u know the answer it is urgent.
|
|
|
|
|
Micrsosoft Access uses SQL, so your query is already SQL.
Is it perhaps Micrososft SQL Server that you want to convert the query for?
It's a bit hard to help you with converting the query without seeing it.
---
b { font-weight: normal; }
|
|
|
|
|
thanks for your reply.
this is the ms acess query(while converting to sql server it creates problem)
SELECT tblEmployee.Emp_Id, tblEmployee.Emp_FName, tblEmployee.Emp_LName, tblClockDetails.Clk_InDate, tblClockDetails.Clk_InTime, tblClockDetails.Clk_OutDate, tblClockDetails.Clk_OutTime, tblProcessedData.pHrsWork, tblProcessedData.pHrsOT, tblProcessedData.pNormOT, tblProcessedData.pOffOT, tblProcessedData.pHolOT, tblProcessedData.pEarlyOut, tblProcessedData.pLateIn, tblProcessedData.pLeaveType, tblDepartment.Dept_Id, tblDepartment.Dept_Name, tblSection.Sec_Id, tblSection.Sec_Name, (CDate([tblClockDetails.Clk_InDate] & " " & [tblClockDetails.Clk_InTime])) AS ClockIn, CDate([tblClockDetails.Clk_OutDate] & " " & [tblClockDetails.Clk_OutTime]) AS ClockOut, DateDiff("n",ClockIn,ClockOut)\60 & ":" & DateDiff("n",ClockIn,ClockOut) Mod 60 AS Totalhrs, Format(Totalhrs,"Short Time") AS TotHrs
FROM ((((tblEmployee INNER JOIN tblEmpWork ON tblEmployee.Emp_Id=tblEmpWork.Emp_Id) INNER JOIN tblDepartment ON tblEmpWork.Emp_DeptId=tblDepartment.Dept_Id) INNER JOIN tblSection ON tblEmpWork.Emp_SecId=tblSection.Sec_Id) INNER JOIN tblProcessedData ON tblEmployee.Emp_Id=tblProcessedData.pEmpId) INNER JOIN tblClockDetails ON tblEmployee.Emp_Id=tblClockDetails.Clk_EmpId
WHERE tblClockDetails.Clk_OutTime <> "" and tblClockDetails.Clk_InTime <> "" and (((tblClockDetails.Clk_InDate)>=(SELECT FromDate FROM tblDateRange) And (tblClockDetails.Clk_InDate)<=(SELECT ToDate FROM tblDateRange)) AND ((tblEmpWork.Emp_Report)='Y')) AND tblClockDetails.Clk_InDate = tblProcessedData.pDate;
the problem arises for
(CDate([tblClockDetails.Clk_InDate]-CDate isnot a recognised function name and then how to cnvert Mod 60 in to sql server.
|
|
|
|
|
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
|
|
|
|