|
Would u show me some code how to use Activator.CreateInstance ?
|
|
|
|
|
|
Where I can found a free C# Outlook-style mini calendar?
Im working in a project of recuuring patterns and I woul like to add some features.
I have seen calendars made in C++ but I dont know nothing this language.
Thank you!
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
Either search this site using the text box below the logo on every page, or use a search engine like google[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thank you, i do that first than post it
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
|
Yes, but not in the outlook style.
I found DatePicker control by Lutz Roeder and its have a outlook style calendar in C#. Im trying to get the calendar control, but it no has some properties than I need, like bolded dates and show multiple mode.
But it seems like theres not already the control Im looking for so I need to code it - if I can .
Thank you.
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
What do you mean when you say outlook style?
"Catalonia is not Spain"
|
|
|
|
|
Hi friends...
a .net application when compiled just work in my system and if i want run it on a system that is not installed .net framework on it, i cant and i see an error... how i can compile my application for all systems...???
also i want a reference for GDI+ and graphics in C# , and Work with math functions in C#
|
|
|
|
|
You cannot compile C# to native Win32, the .NET framework is required.
|
|
|
|
|
There's got to be a way you can include a "mini" MSIL interpreter and package the right DLLs with a project... But I can't remember how to do that right now. Hopefully someone else can.
vir·tu·al re·al·i·ty
n. Abbr. VR
A computer simulation of a real or imaginary universe in which Microsoft APIs are thoroughly documented and behave in an entirely logical manner.
|
|
|
|
|
That's BAD! Not only is it not servicable (so that updates to the .NET Framework absolutely WILL NOT apply to your hack) you destroy the very nature of the Framework. If you do something like this (and there is a product that does this) you are responsible for updating your application every time a service pack or generate update is required. It will not - and cannot - be updated automatically by Windows Update or any other method that will update the .NET Framework. This is true for the other platforms I mentioned below.
Applications that target the .NET Framework require the .NET Framework, just like Java applications require a JVM and, more than likely, the JRE (like the .NET BCL), VB6 (and below) applications require the VB Runtime (msvbvm60.dll), and most C/C++ applications require at a minimum the standard C runtime.
In every case, if you import or otherwise use functionality defined elsewhere you require that component. The .NET Framework isn't just a class library - it's a complete runtime with unmanaged components to make the runtime possible (just like a JVM or the VBVM, etc.).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I didn't think the OP was working on an "enterprise solution" or anything that's going to need constant servicing. Maybe his other machine, or his friend has Windows 95 and doesn't want to install the framework because they don't have the space? I understand completely that .NET comprises an entire framework, but I see that the OP could have gotten the wrong idea from my suggestion. It's good that you clarified.
vir·tu·al re·al·i·ty
n. Abbr. VR
A computer simulation of a real or imaginary universe in which Microsoft APIs are thoroughly documented and behave in an entirely logical manner.
|
|
|
|
|
Every time a security patch comes out you should install it. Since it can't and will not install over the hack (it's not even detectable; you broke it) you're still vulnerable. So you, as the developer, would have to re-link all your assemblies with the BCL assemblies and redeploy when important security updates are released. It's not servicable like the .NET Framework would be.
Besides, 1) Win95 doesn't support the .NET Framework, and 2) it's only about 25 MB installed. If someone doesn't have that much space left, not being able to run a particular application should be the last of their worries.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
I created a column subclassed from DataGridBoolColumn that has clickable checkboxes. However, if you click the datagrid header for this column it's sorting on the boolean columns original values I think. How can I force the column to sort based on the set/unset value of the checkbox at the moment?
thanks,
Deanna
|
|
|
|
|
Hi all!
For my vs .net 2003 add-in I need a possibility to show hints (-> ToolTip Component?) on words in the VS text-editor. Unfortunately the ToolTip Component can only be applied to controls (the DTE (application) -object does not have any class that is derived from control...
Better than this would be a possibility to implement ms-word-comments in vs .net but i dont think that this is possible, even if i would save the comment-string on my own.
Perhapts anyone can help.
ps: please excuse my bad english
|
|
|
|
|
That's because you're not programming against a .NET application. The EnvDTE assembly is a COM interop assembly (RCW) that allows managed code to marshal calls to native COM components. Of course you won't find anything derived from the System.Windows.Forms.Control class.
You have to use native tool tips, which are documented in the Platform SDK at http://msdn.microsoft.com/library[^]. Specifically, read ToolTip Controls[^].
You might also search MSDN[^] for helpful articles. There have been quite a few covering VS.NET Add-ins and one might just discuss what you need. More often than not, these articles - like here on CodeProject - are accompanied with sample source code.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks a lot. This is exactly the information i needed.
|
|
|
|
|
Hello,
I am developing a library system. I have 2 tables, book and student. The relationship is 1 student can have many books. I am having updating the book table when the student returns the book, the studentID (foreign key) will be cleared from the book table. I think this is the problem l am having. My code is listed below with the error description.
try<br />
{<br />
cnnReturnBook.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\IBS Library System\LibrarySystem.mdb;Persist Security Info=False";<br />
<br />
OleDbCommand cmdReturnBook = cnnReturnBook.CreateCommand();<br />
cmdReturnBook.CommandText = @"SELECT * FROM BOOK<br />
WHERE RefNumber = '" + txtBookRef.Text + "' ";<br />
<br />
OleDbDataAdapter daReturnBook = new OleDbDataAdapter(cmdReturnBook);<br />
OleDbCommandBuilder cbReturnBook = new OleDbCommandBuilder(daReturnBook);<br />
<br />
if ( daReturnBook.Fill(dtReturnBook) == 1 )
{<br />
txtDateOut.Text = "";<br />
txtDateDue.Text = "";<br />
txtStatus.Text = "Available";
txtIDNumber.Text = "";
txtName.Text = "";<br />
txtSurname.Text = "";<br />
<br />
dtReturnBook.Rows[0]["Status"] = txtStatus.Text;<br />
dtReturnBook.Rows[0]["DateOut"] = txtDateOut.Text;<br />
dtReturnBook.Rows[0]["Remarks"] = txtRemarks.Text;<br />
dtReturnBook.Rows[0]["StudentID"] = txtIDNumber.Text;<br />
dtReturnBook.Rows[0]["DateDue"] = txtDateDue.Text;<br />
<br />
daReturnBook.Update(dtReturnBook);
}<br />
}<br />
catch ( OleDbException ex )<br />
{<br />
MessageBox.Show(ex.ToString(),"Exeception has occurred",MessageBoxButtons.OK,MessageBoxIcon.Warning);<br />
}<br />
catch ( Exception ex )<br />
{<br />
MessageBox.Show(ex.ToString(),"Exeception has occurred",MessageBoxButtons.OK, MessageBoxIcon.Warning);<br />
}<br />
finally <br />
{<br />
cnnReturnBook.Dispose();<br />
}<br />
}
Error description
System.Data.OleDb.OleDbException: You cannot add or change a record because a related record is required in table 'Student'.
At System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
At System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
Thanks in advance,
Steve
|
|
|
|
|
I think that the problem is that you've entered the id of a student that doesn't exist in the Database. Either enter a corresponding student into the database or remove the constraint that there must be a student actually responsible for the loan.
|
|
|
|
|
This should really be posted in the ADO.NET forum[^], but I'll try an answer it anyway.
Without knowing more about your data model, I'm guessing that you have no student whose Id is an empty (zero length) string (This is not the same as NULL). And when you update the table the row is trying to relate itself to a student with an empty string ID.
If my guess is correct: You should set StudentID in the BOOK table to be nullable. If the student is to be cleared you should set the value of the column to be DBNull.Value .
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Hello
Thanks for your help. I did what you asked, but l am still having the same problem. As i am using MS Access i can't set the StudentID in the book table to be Nullable.
dtReturnBook.Rows[0]["StudentID"] = DBNull.Value; //Gave a compile error
dtReturnBook.Rows[0]["StudentID"] = DBNull.Value.ToString(); //Gave the same error as the first problem.
The problem remains, l need to clear the StudentID in the book table, as the student no longer has that book.
Any other ways to solve this problem.
Thanks in advance,
Steve
|
|
|
|
|
steve_rm wrote:
As i am using MS Access i can't set the StudentID in the book table to be Nullable.
I've not used Access in a few years, so I may be wrong, but you can set Required to No - which is the same as saying Nullable.
steve_rm wrote:
DBNull.Value; //Gave a compile error
Not sure why that would be...
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Hello. I'm working on a performance critical component, and need buffers to work in. I'll only need one buffer per thread, (at most) so I'll store one in thread-local-storage and I'll keep a record on the average needed size, per AppDomain. Thus I'll change the size of the pooled buffers peridocially to the average size (rounded up to the nearest SystemPageSize, which is usually 4K).
So, the question is if this is even a good idea in managed code at all? If I was working in unmanaged code, I'd not even have asked, but now I don't know if it's simply better to call new byte[requiredSize].
|
|
|
|
|
Better is a relative term. If "better" == "safer", then new byte[requiredSize] is better. If "better" == "faster", then you'll get better performance by P/Invoking HeapAlloc or similar. The problem with this approach is that the memory is unmanaged by the CLR so it can't track it. You could marshal it to an IntPtr and use that in managed code, but the buffer is still allocated on the unmanaged heap (or stack if you used something like _alloca ). You'll have to free it explicitly. This is where wrapping such functions in a class following the disposable pattern is handle, and .NET 2.0 will introduce the SafeHandle for just such a purpose. You can either define your own now, or take a look at the GCHandle and HandleRef structs under System.Runtime.InteropServices which may be helpful depending on how you're using the memory (especially if you need to marshal managed types to native memory).
There is yet another way, though. Read about C#'s stackalloc operator keyword. This, of course, will alloc memory on the heap and give you an unsafe (i.e., has access to direct memory and is not GC'd) pointer.
HTH
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|