|
I am looking for suggestions on a good way to visually layout database designs and class designs. I have seen in some articles where the database looks to be a screen shot from the SQL diagram and some articles show class designs.
|
|
|
|
|
I personally use a good ol' whiteboard. I invested in a 1200x900mm magnetic one a few weeks ago - I can't live without it now! However, a lot of people swear by Visio, as well.
If you're looking for a free alternative, you could try Dia[^]. Dia is an open-source diagram modelling tool which appears to be fairly good.
This space for rent!
My Blog
|
|
|
|
|
If you have a control on a windows form that has a ContextMenu enabled, and you would like to know WHICH control it is that the user has right-clicked, is it possible to pass the name of the control through to the menu click event so that it could process the control using that information? The sender object only retrieves the MenuItem object and not the name of the control that activated the menu click. How would I acquire the name of the control that activated the ContextMenu click event?
|
|
|
|
|
Like this:
MenuItem miSender = (MenuItem)sender;
ContextMenu cmSender = (ContextMenu)miSender.Parent;
TextBox tbSender = (TextBox)cmSender.SourceControl;
|
|
|
|
|
Thank You, Guinness4Strength ! Much appreciated.
New_Phoenix
|
|
|
|
|
I didn't see a DirectX board so I thought I'd post here since I am writing in C#.
I am having an issue with setting some vectors on a CustomVertex. Here is my code:
<br />
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)<br />
{<br />
device.Transform.Projection = Matrix.PerspectiveFovLH((float)Math.PI/4, this.Width/this.Height, 1f, 50f);<br />
device.Transform.View = Matrix.LookAtLH(new Vector3(0,0,30), new Vector3(0,0,0), new Vector3(0,1,0));<br />
device.RenderState.Lighting = false;<br />
device.RenderState.CullMode = Cull.None;<br />
<br />
CustomVertex.PositionColored[] vertices = new CustomVertex.PositionColored[3];<br />
vertices[0].SetPosition(new Vector3(0f, 0f, 0f));<br />
vertices[0].Color = Color.Red.ToArgb();<br />
vertices[1].SetPosition(new Vector3(10f, 0f, 0f));<br />
vertices[1].Color = Color.Green.ToArgb();<br />
vertices[2].SetPosition(new Vector3(5f, 100f, 0f));<br />
vertices[2].Color = Color.Yellow.ToArgb();<br />
<br />
device.Clear(ClearFlags.Target, Color.DarkSlateBlue, 1.0f, 0);<br />
<br />
device.BeginScene();<br />
device.VertexFormat = CustomVertex.PositionColored.Format;<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 1, vertices);<br />
device.EndScene();<br />
<br />
device.Present();<br />
<br />
this.Invalidate(); <br />
}<br />
The problem is with the vertices[x].SetPosition(new Vector3(0f, 0f, 0f));
When I try to compile, I get the error message: Microsoft.DirectX.Direct3D.CustomVertex.PositionColored does not contain a definition for SetPosition.
I have also tried: vertices[x].Position.Add(new Vector3(0f, 0f, 0f));
This doesn't give me an error, but it also doesn't render anything on the screen.
Also, I can render the triangle if I use CustomVertex.TransformedColored so I know that is working, but I need to use CustomVertex.PositionColored
In most of the examples I have seen, this is how it is done. If you know DirectX, then you also know it is very hard to find any sort of good documentation on it too. I don't know if most examples I am following are 8.0 and earlier. Is there another way to do this? Am I doing it right but missing something?
|
|
|
|
|
Hey!
I Have two list box the second list box need to be updated when the first listbox is updated with an item.
Is there any event that i can use on the first Listbox and by that update my secon list box?
I are adding data to my first list box from many places!
//SnowJim
|
|
|
|
|
What do you mean with updated; adding a value to the ListBox or a change of the selected value?
In case of the latter write an event handler for either the SelectedIndexChanged or the SelectedValueChanged event and update the second ListBox according to the selected value.
www.troschuetz.de
|
|
|
|
|
As soon as an item is addad i whant i event to be raised there i can write the new item into the seond listbox.
Else i will have to do i funktion that al are using, there i also change the second listbox but this will be alot to change.
So i thought that maby there is an event that is raised when an item is added that i can use?
//SnowJim
|
|
|
|
|
|
I've written an Add-in that creates a CommandBar with a CommandBarButton and CommandBarComboBox control. It looks and works great the very first time the add-in is run (when the OnConnection method executes). But if I close VS and re-open it, only the CommandBarButton control is the only control present. Below is the OnConnection method I use to create the CommandBar. Do I need to add the CommandBarComboBox control in a different way ?
public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
{
applicationObject = (_DTE)application;
addInInstance = (AddIn)addInInst;
if(connectMode == Extensibility.ext_ConnectMode.ext_cm_UISetup)
{
object []contextGUIDS = new object[] { };
Commands commands = applicationObject.Commands;
_CommandBars commandBars = applicationObject.CommandBars;
try
{
Command cmd = null;
try
{
cmd = commands.Item(FullCommandName,0);
}
catch(Exception Err)
{
Debug.WriteLine("OnConnection: "+Err.Message);
}
if(cmd!=null)
cmd.Delete();
cmd = commands.AddNamedCommand(addInInstance,CodeDepotRes.ProgID,CodeDepotRes.CommandName,CodeDepotRes.ToolTip,false, 102,ref contextGUIDS,(int)vsCommandStatus.vsCommandStatusSupported+(int)vsCommandStatus.vsCommandStatusEnabled);
CommandBar Bar = GetCommandBar(CodeDepotRes.ProgID);
if(Bar!=null)
commands.RemoveCommandBar(Bar);
Bar=(CommandBar)commands.AddCommandBar(CodeDepotRes.ProgID,vsCommandBarType.vsCommandBarTypeToolbar,null,0);
CommandBarButton btn = (CommandBarButton) cmd.AddControl(Bar, 1);
btn.Style = MsoButtonStyle.msoButtonIcon;
CommandBarComboBox DropBox = (CommandBarComboBox) Bar.Controls.Add(
MsoControlType.msoControlDropdown,oMissing,oMissing,oMissing,oMissing);
DropBox.Width=300;
DropBox.AddItem("[Open Code Depot Manager]",oMissing);
DropBox.Caption = "Snipets:";
DropBox.Style = MsoComboStyle.msoComboLabel;
}
catch(System.Exception Err)
{
Debug.WriteLine("OnConnect:"+Err.Message);
}
}
}
Any thoughts would be greatly appreciated...
|
|
|
|
|
hi
how to create arraylist files?
i want to add modifi and erase inside datas
help me
thanks
|
|
|
|
|
suthagar wrote:
how to create arraylist files?
An arraylist is a data structure. What do you want to do, place the contents of an arraylist into a file ? All you need to do is use for each to step through the array list.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i'd like to make an application that runs on the site without posting back, like the java applet, but i don't want to write java, so my questions is , is there anyway that let me make somethin like the java applet in C# ASP.NET ??
where can i look at ?
thanx
|
|
|
|
|
Why would you want to do that ? Your users would have to download it, and they would have to have the .NET runtime installed. What's the benefit of embedding it in a browser if you're just going to send them the .exe anyhow ?
You could do that with ActiveX controls, so I don't see any reason why you couldn't do it in C#, given that C# can be used to write COM components.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i want to do that coz i'd like to make somthin like playing chess on the web, that don't require posting back to the server, actually i didn't use activex b4, so i'll take a look,
thanx for reply
|
|
|
|
|
Maybe you are thinking of web services? Im somewhat confused by the question.
You can find how the description of how to set them up here:
http://www.codeproject.com/cs/webservices/
You will need a server running IIS with ASP.Net going on too. Basically, you can call a void function or something like this? This isn't a site though. I think there is a way to call managed code just from a script so you can just use that if you want.
I hope this helps,
|
|
|
|
|
Hi,
How do i show all tables from a Ms-Access database using OleDBConnection?
Thank u very much,
Dirso
|
|
|
|
|
I am working with an application that requires the utilization of the System.Diagnostics namespace. It involves the creation of a new process(), but I would like the process to NOT open a new window when process.start() occurs. I would prefer the process to run transparently in the background.
I realize that there is a System.Diagnostics.process.startinfo.createnowindow method that I believe would prevent the process from opening a new window with the required file information (ie a compressed .zip file using WinZip) but when I use this method, it still opens the winzip program with the appropriate process.FileName that I pass to it.
What is the proper syntax to use the process.startinfo.createnowindow method? How could I prevent the winzip application from opening? Any ideas?
|
|
|
|
|
Hello,
I have a structure that I want to fill with bytes from a byte array.
public struct DUMMY<br />
{<br />
public ushort dummy1;<br />
public ushort dummy2;<br />
public ushort dummy3;<br />
public ushort[] dummy4;<br />
}<br />
<br />
private byte [] filedata = new byte[512];<br />
<br />
public void MemCopy(ref byte [] source, ref object dest)<br />
{<br />
IntPtr Ptr = Marshal.AllocHGlobal(Marshal.SizeOf(dest));<br />
Marshal.StructureToPtr(dest, Ptr, true);<br />
int size = Marshal.SizeOf(dest);<br />
Marshal.Copy(source, 0, Ptr, size);<br />
}<br />
<br />
<br />
I tried to do it with the MemCopy function but after the Copy dest is still empty. All I'm looking for is a c++ memcpy replacement. If possible in a Managed way.
Thanks,
Arjan
|
|
|
|
|
|
HI,
i am trying to retreive records for order with in a specified range of dates. I have created sql string as follows :
//create the sql
sql = "SELECT * FROM vShipments WHERE DateOrdered BETWEEN'" + txtOrderDateFrom.Text + ", '" + "AND '" + txtOrderDateTo.Text + "'";
-------------------------------------------
On execution, i am getting following error(s) :
System.Data.SqlClient.SqlException: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
at System.Data.SqlClient.SqlDataReader.Read()
at InventoryControl.frmShipments.PopulateListView(String filter) in d:\shirtuniverse\inventorycontrol\frmshipments.cs:line 786
------------------------------------------------------------
Any idea(s) : what i am doing wrong
Thanx in advance
|
|
|
|
|
ronin1770 wrote:
//create the sql
sql = "SELECT * FROM vShipments WHERE DateOrdered BETWEEN'" + txtOrderDateFrom.Text + ", '" + "AND '" + txtOrderDateTo.Text + "'";
Looking this over are you sure you need the comma after the first date. Its inside the single quote. You might try:
sql = "SELECT * FROM vShipments WHERE DateOrdered BETWEEN '" + txtOrderDateFrom.Text + "' AND '" + txtOrderDateTo.Text + "'";
Steve Maier, MCSD MCAD
|
|
|
|
|
ronin1770 wrote:
Any idea(s) : what i am doing wrong
This probably isn't what you were looking for, but I feel that I'd be remiss if I didn't point it out anyway.
Since you're simply echoing user input (txtOrderDateTo.Text ) into a SQL statement, you have left yourself wide open to a SQL injection attack. Google will yield you a good set of results on a search. For convenience, here is an article[^] to get you started.
Hope that helps a bit.
--Jesse
|
|
|
|
|
ronin1770 wrote:
Any idea(s) : what i am doing wrong
So many things, it's almost funny!
1) You're using string concatentation to build an SQL statement. The gods around here will smite you for such foolishness. Like the other posters pointed out, you have opened yourself up to many an SQL injection attack.
2) There is no space between the keyword BETWEEN and the single quote next to it. There should be...
3) A comma between your first date and the keyword AND will cause an error in the SQL statement.
4) Your completely at the mercy of the user to type in the date in the EXACT format that is required by the SQL statement.
We've said this a thousand times in the forums: CONVERT THIS STATEMET INTO A PARAMETERIZED QUERY! If you were to release code like this into a production application and sell it, your customers will hang you by your nads when they find out about it!
The SqlParameter objects will handle filtering for SQL Injection attacks for you and handle converting the DateTime objects you supply into the correct SQL format.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|