Click here to Skip to main content
14,924,531 members

Comments by TnTinMn (Top 107 by date)

TnTinMn 19-Feb-14 21:28pm View
   
This is from a search I ran on 16-bit x-ray image format.
ezDICOM DICOM viewer: http://www.mccauslandcenter.sc.edu/mricro/ezdicom/index.html

It may be worth downloading the viewer and trying it.
TnTinMn 12-Feb-14 13:24pm View
   
Just throwing this out there as a possible SerialPort example source.
http://www.hardandsoftware.net/Downloads.htm
TnTinMn 11-Feb-14 20:38pm View
   
I am a bit confused as I'm sure you are with this. One thing that I am going to recommend is that do not build the connection string path every place you need it as that can be a source of errors (not saying that that is the cause of your current problem). Add a project property setting of type connection string and use that when needed. Do not include the password as part of the stored string; you can append that at startup.

i.e.: Data Source=|DataDirectory|Northwind.sdf

Make sure you set the DataDirectory for the application before any calls are made that will need the path
i.e: AppDomain.CurrentDomain.SetData("DataDirectory", Application.StartupPath);

The only way I have been able to recreate your issue is by using a dataset and editing it between runs. This seems to force VS to copy the original DB to the output directory even if it is older.

You could also try setting "Copy To Output" to "Do Not Copy"; just make sure that you have a copy in the output directory and see if that resolves the issue.

I'm sorry, but I really do not know what else to recommend at this point.

Good Luck.








TnTinMn 11-Feb-14 11:50am View
   
Download - Samples Environment for Microsoft Chart Controls
http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=4418
Load "WinFormsChartSamples.sln" and run it.
In the application, under the "Contents" tab, open "Data Distribution Charts" and then select Histogram. This will help teach you how to create one.
TnTinMn 6-Feb-14 19:37pm View
   
"I mean, I add, delete and modify records, and it works okay i can play with all my information while the app is running. BUT if I close the app and after it, I run it again, all the data is like in the begining, there's not any change in my DB.sdf"
Does this mean that you have pulled the modified data and show the the modified table in the UI or does it just mean that nothing crashed?
TnTinMn 5-Feb-14 19:45pm View
   
When you created the datasource, did you click Yes when prompted by this dialog?
---------------------------
Microsoft Visual Studio
---------------------------
The connection you selected uses a local data file that is not in the current project. Would you like to copy the file to your project and modify the connection?
---------------------------
Yes No Help
---------------------------

This is a common issue when people say their changes when running under VS are not persisting. If you did, you will see the database file in the Solution Explorer. Check the properties of the file. Most likely "Copy To Output" is set to "Copy Always"; change it to "Copy If Newer".
TnTinMn 4-Feb-14 14:05pm View
   
The Millisecond property only returns the millisecond component (0 to 999) of the DateTime value.
OP asked: how do i calculate system time in milliseconds?
TnTinMn 1-Feb-14 20:33pm View
   
Not my area, but a quick search on you error message brought up this:
http://msdn.microsoft.com/en-us/library/aa302290.aspx

It describes trouble shooting this type of error. Based on a quick reading, you should look at the inner exception. Maybe if you post that message's info as shown in the article, someone can help you.
TnTinMn 31-Jan-14 14:33pm View
   
While for most users, the answer I posted will work it does have a weakness. Please see my response to Bill below.

Also, if you are the one who down-voted his answer, please modify your vote to a five.

Also please accept his answer.
TnTinMn 31-Jan-14 14:28pm View
   
I have +5 this to try to offset that 2 vote and hope that others will as well.
TnTinMn 31-Jan-14 14:26pm View
   
Bill, I must admit I had a "What is he talking about" moment when I read your first comment, but I got over it as I read on and saw that you had placed a MessageBox in the handler (the beeping little bugger). :))

However, during my testing to write this response, I came to realize that your method is probably the better one to use as it will trap key-strokes from those of us who were taught programming and computer usage back in the stone-age. :))

The TextBox.AcceptsReturn property only comes into play when MultiLine = true and Form.AcceptButton != null.

I don't know if this is useful, but the following is synopsis of results of pressing "Enter" key with the various setups.

1. Form.AcceptButton = null, TextBox.MultiLine = false, AcceptsReturn = true or false

KeyDown & KeyPress & KeyUp fire.

2. Form.AcceptButton = null, TextBox.MultiLine = true, AcceptsReturn = true or false

KeyDown & KeyPress & KeyUp fire.

3. Form has AcceptButton, TextBox.MultiLine = false

AcceptButton.Click fires
KeyDown & KeyPress are not fired when you press Enter.
KeyUp does fire.

4. Form has AcceptButton, TextBox.MultiLine = true, AcceptsReturn = false (need to use ctrl-Enter for new line)

AcceptButton.Click fires
KeyDown & KeyPress are not fired when you press Enter.
KeyUp does fire.

5. Form has AcceptButton, TextBox.MultiLine = true, AcceptsReturn = true

AcceptButton.Click does not fire
KeyDown & KeyPress & KeyUp fire.

And now for my admittance that your method is probably the .

The key event handlers process sequentially: KeyDown, KeyPress, KeyUp (http://msdn.microsoft.com/en-us/library/vstudio/system.windows.forms.control.keydown%28v=vs.100%29.aspx).

If you set "e.SuppressKeyPress = true;" in the KeyDown handler, the KeyPress event does not fire and the KeyUp event fires. In common keyboard usage, using this method will work, however for the most robust method would be to handle the KeyPress event for "e.KeyChar == 13" and set "e.Handled = true;". This is because the KeyPress event is raised in response to WM_CHAR or WM_IME_CHAR messages.

To demonstate the failure of the "e.SuppressKeyPress = true" method, try entering Ctrl-M or Alt-(on NumPad)013 (hold Alt Key then press/release NumPad keys 0, 1, 3) ; these will both generate as KeyPress event with "e.KeyChar = 13", but will not generate a KeyPress event with "e.KeyCode = Keys.Enter".

So in my final analysis, the method you showed is the best to catch the various ways that a carriage return can be inputted on a PC.

TnTinMn 30-Jan-14 21:46pm View
   
Reason for my vote of 5 \n Neat trick.
TnTinMn 29-Jan-14 17:46pm View
   
I do not have Abode, so I have no idea if any of these hacks would work. The first one probably is the safest method.

1. If the PS file exists before printing delete it. Print to PS file. Run a loop where you check in the file exists and you can open it with exclusive access. Sleep on failure. Once you have an exclusive lock, close the file and proceed. Put in some type of maximum iteration control.

2. Assuming that AdobePDF uses the print queue, create an instance of System.Printing.PrintQueue and check that the NumberOfJobs property. If zero, I would assume that objWordDoc.PrintOut has finished and that the file is created.

3. If the AdobePDF driver spawns a new process each time you print (big assumption), you may be able to use WMI and a WqlEventQuery to capture the __InstanceCreationEvent and __InstanceDeletionEvent events for that process. The __InstanceDeletionEvent would signal that the file has been created.


TnTinMn 28-Jan-14 21:54pm View
   
Are you targeting MS Word 2003 and earlier? If not, why not save the document in PDF format directly from Word?
TnTinMn 28-Jan-14 19:30pm View
   
I do not understand your desire to insert a ProgressBar control into the DataGridview (I also do not know how you would accomplish your goal with the given constraints). You can subscribe to the CellPainting event and draw pretty much whatever you want subject to the limits of your skill in using the GDI+ methods available to you.

Try playing around with the code from this example.
http://msdn.microsoft.com/en-us/library/hta8z9sz%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1

Hint: Create a Rectangle and assign it the value of e.CellBounds. Then set its width property to half the original width and call e.Graphics.FillRectangle with this new rectangle.
TnTinMn 27-Jan-14 20:22pm View
   
Please clarify your requirement.

Do you want to write a Binary Coded Decimal (or packed decimal, comp-3) file that would be read by a COBOL program?
I have never done this, but I found this old MS article that does the reverse (reads a BCD file). It has a lot of info on the file format that may help you. Just note that it is in BASIC not VB.Net.

http://support.microsoft.com/kb/65323
TnTinMn 27-Jan-14 15:06pm View
   
Are you trying to create a gantt chart like this (http://1.bp.blogspot.com/-TwlAv6pqwF4/UQbJJB4kRUI/AAAAAAAAAyw/XcmK5mix-wA/s1600/Gantt+chart.jpg) or something similar using the DataGridView control?
TnTinMn 24-Jan-14 9:25am View
   
I was using 4 "calc.exe" instances. I just changed to using one Windows Media Player with video playing and three "calc.exe" instances. That also worked fine.

So I guess that WPF is just a pig with updating. You could also try setting the SWP_NOSENDCHANGING flag to prevent the window from receiving the WM_WINDOWPOSCHANGING message. It may be that WPF does a bunch of stuff on a move.

I have not tried this, but I wonder if you sent the application the WM_SETREDRAW message to disable redrawing before moving it would work? A window does not need to process this message.

Anyway, it sounds like you are focused in on the true problem.



TnTinMn 23-Jan-14 19:02pm View
   
Something is amiss here!

This interested me; so I hacked out a version of what you are doing and it works fast and looks good. I ran it on both Vista/32 and Win8.1/64 with no issues and the Vista machine is an old laptop that runs like molasses at the North Pole. :)

I defined my variables a bit different than you did, but I think you will comprehend the meaning
IntPtr windowpositionstructure = default(IntPtr);
for (Int32 i = 1; i <= 300; i++)
{
windowpositionstructure = BeginDeferWindowPos(Windows.Count);
foreach (Window w in Windows)
{
if (windowpositionstructure != IntPtr.Zero)
{
windowpositionstructure = DeferWindowPos(windowpositionstructure,
w.hwnd,
IntPtr.Zero,
w.pos.X + 1,
w.pos.Y,
0, 0,
DeferWindowFlags.NOACTIVATE |
DeferWindowFlags.NOSIZE |
DeferWindowFlags.NOZORDER);
w.UpdatePosition();
}
}
bool res = false;
if (windowpositionstructure != IntPtr.Zero)
{
res = EndDeferWindowPos(windowpositionstructure);
System.Threading.Thread.Sleep(1); // needed to slow it down a bit
}
}
Since I am not changing z-order, I passed it IntPtr.Zero for hWndInsertAfter and since the size is not changing I dive it 0 for cx and cy). My Window class has a Point structure to store its position.

Note that I did not disable ReDraw.
TnTinMn 23-Jan-14 15:02pm View
   
Darn!, worth a shot though.

What is the surveilWidget method? I'm guessing that it is a call to GetWindowRect. If so,I would think that this could be called at the start of the movemovement and the position updated in your code by adding the requested movement. That would be one less interop call per window on each iteration. May not be much gain though.

Edit: Might as well set the SWP_NOSIZE and SWP_NOACTIVATE flags as well.
TnTinMn 23-Jan-14 12:56pm View
   
Just an observation and guess.

hWndInsertAfter is set to HWND_NOTOPMOST, does setting the SWP_NOZORDER flag help the performance? It may eliminate some z-order checking and the determination if the window is topmost or not.
TnTinMn 21-Jan-14 19:04pm View
   
see: Sending complex emails in .NET 1.1
http://www.codeproject.com/Articles/13236/Sending-complex-emails-in-NET-1-1
TnTinMn 21-Jan-14 17:31pm View
   
I have never experienced this issue. It sounds more like malware than anything else.
Have tried to re-install the Control?

Microsoft Chart Controls for Microsoft .NET Framework 3.5
http://www.microsoft.com/en-us/download/details.aspx?id=14422
TnTinMn 21-Jan-14 16:00pm View
   
+5 for the list, but you missed at least one reference. :)

Adding Tables to Word 2010 Documents by Using the Open XML SDK 2.0
http://msdn.microsoft.com/en-us/library/gg490656.aspx
TnTinMn 21-Jan-14 0:35am View
   
It is not completely clear what your intent is. Based on the code you have shown, it appears that you want to scroll to to the selected account Id. But then you state "rearrange datagrid"; this implies that you may want to make the found row the first row (not just first scrolled to row).

If it is just scrolling, change "dr.Cells(3).Value" to "dr.Cells(3).Value.ToString()" so that you are comparing string values. Your code appears fine for a DataGridView configured with MultiSelect=False.

If you want to rearrange the displayed row order, I can provide you an example of how to do this using "LINQ to DataSets".
TnTinMn 14-Jan-14 19:34pm View
   
Based on your stated criteria, I suggest the following API method.

[DllImport("user32", CharSet=CharSet.Unicode)]
internal static extern int MessageBeep(int uType);

with uType = 0xFFFFFFFF -- A simple beep. If the sound card is not available, the sound is generated using the speaker.

see: http://msdn.microsoft.com/en-us/library/windows/desktop/ms680356%28v=vs.85%29.aspx
TnTinMn 6-Jan-14 23:33pm View
   
" if I've positioned an image 30% of the way across the panel, I need it to be 30% across the panel even when the panel has resized. "

I may be oversimplifying this, but why not set the Location of the picturebox in the Panel.Resize event handler to be 30% of panel's width?
TnTinMn 5-Jan-14 10:05am View
   
I think your method to get the MDIClient control could be dehackified (hey, a new word :)) if you iterated the form's control collection like shown here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.ismdicontainer%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2
versus relying on the control to be the last control in the collection.

Perhaps Something like this:
private MdiClient GetMDIClientControl(Form frm)
{
MdiClient ret = null;
if (frm.IsMdiContainer)
{
foreach (Control c in frm.Controls)
{
if (c is System.Windows.Forms.MdiClient)
{
ret = (MdiClient)c;
break;
}
}
}
return ret;
}
TnTinMn 1-Jan-14 14:57pm View
   
I have added the information that your erroneously submitted as a solution to your question. Please delete "Solution 2" that you posted.
Thanks.
TnTinMn 18-Dec-13 23:03pm View
   
Thanks for the reply. In regards to the comment on the use of "TypeOf [object] Is Type", for VB the usage is correct for testing whether the object is derived from the Type.

What I really wanted to know was if you you saw any issues with using the conditional catch clauses as I showed in the second method. But I get the feeling that you primarily work in C# that does not support the conditional catch, so you may not be familiar with it.
TnTinMn 18-Dec-13 22:05pm View
   
Sorry for butting in here, but this caught my interest and I am not sure I understand you fully.

Using a silly example, are you saying that it is better use a pattern like this:
Sub dumbtest()
Dim num As Int32 = 100 : Dim v1 As Int32 = 0 : Dim v2 As Int32 = 3
Dim res As Int32
Try
res = num \ (v1 * v2)
Catch ex As Exception
If TypeOf ex Is DivideByZeroException Then
If v1 = 0 Then
Throw New MyAppExeception("why was v1 = 0 in dumbtest")
ElseIf v2 = 0 Then
Throw New MyAppExeception("why was v2 = 0 in dumbtest")
End If
End If
' do something else
End Try
End Sub

Versus something like this?
Sub dumbtest2()
Dim num As Int32 = 100 : Dim v1 As Int32 = 0 : Dim v2 As Int32 = 3
Dim res As Int32
Try
res = num \ (v1 * v2)
Catch v1_zero As DivideByZeroException When v1 = 0
Throw New MyAppExeception("why was v1 = 0 in dumbtest")
Catch v2_zero As DivideByZeroException When v2 = 0
Throw New MyAppExeception("why was v2 = 0 in dumbtest")
Catch ex As Exception
' do something else
End Try
End Sub

TnTinMn 18-Dec-13 19:29pm View
   
Unfortunately, his code will compile if "Option Strict" is off. I really wish MS would have depreciated these hold overs from VB6 when they depreciated the "Microsoft.VisualBasic.Compatibility.VB6" Namespace. I can understand their desire to provide an upgrade path, but it has been long enough. Or at the very least, set the VB IDE defaults to have Option Strict, Option Explicit "On" and Option Infer "Off. It would eliminate many problems for all.

TnTinMn 13-Dec-13 13:49pm View
   
+5 Thanks, I learned something new. :)
TnTinMn 12-Dec-13 23:37pm View
   
Is there a reason that using PowerPoint interop to export the slide is not an option? Or did it not even occur to you to do it that way?
TnTinMn 12-Dec-13 16:43pm View
   
You mention adding "Labels", but what type of control is "n"? I am not familiar with a control that has ContainerColumn and ContainerRow properties. Is a custom control that you defined?
TnTinMn 11-Dec-13 23:39pm View
   
You may also want to tell him how to enter the arguments on the Debug Tab under Project->Properties as he is probably running through the IDE.
TnTinMn 11-Dec-13 22:51pm View
   
+5 - Nice description
You may want to add some of the info from this article:
Avoiding Problems with the Using Statement: http://msdn.microsoft.com/en-us/library/aa355056%28v=vs.110%29.aspx
It describes how the "using" statement can actually cause and hide exceptions.
TnTinMn 11-Dec-13 18:17pm View
   
What plan? You still have not shown any code implementation that you wrote.
TnTinMn 11-Dec-13 18:15pm View
   
Thanks. Unfortunately based on his comment, it appears that he just does not understand the concept of showing some code.
TnTinMn 11-Dec-13 9:17am View
   
You are welcome.

I also suggest that you add a lot of comments to your code about what worked (and didnot work) to get the effect you wanted. This is one of many areas that I find the documentation almost worthless and I find myself referring back to my old code quite often (or maybe it is that I am just getting old and forgetful :)).
TnTinMn 10-Dec-13 23:32pm View
   
It would help if you state what the error message is that you receive.

Also, I think your code fragment would be better if you did it like this:
Dim lAlign As System.Drawing.StringFormat = System.Drawing.StringFormat.GenericTypographic
lAlign.Alignment = StringAlignment.Far
TnTinMn 9-Dec-13 16:12pm View
   
If you are referring to the code in that article, you are of course correct. For a container control (like the OP's panel), a transparent effect can be easily created by setting the Region property. I have added an example of this to my solution.
TnTinMn 9-Dec-13 16:05pm View
   
I did not try the article code before posting link. My primary goal at the time was to point you to some documentation on the issue.

I have have revised my post and have included a simple transparent panel example. Just note that it will not appear transparent in the designer, but will appear transparent at runtime.

Edit: Just add the code to your project and build it. The TransparentPanel control should show up at the top of your toolbox. Then you can add it to your form.
TnTinMn 7-Dec-13 12:06pm View
   
No one is going to do your homework for you. If you really expect some one to do your work for you so that you can look smart, I suggest you get out of the programming curriculum and enroll in a business administration program. This type of laziness and deception tends to be rewarded in that field.
TnTinMn 5-Dec-13 1:09am View
   
From your image, it appears to me that it printed 100 pts from the left edge and 200 pts from the top. Please explain why you believe it is incorrect.
TnTinMn 4-Dec-13 15:51pm View
   
Presumably you are getting one or more instances of the Process Class (http://msdn.microsoft.com/en-us/library/system.diagnostics.process%28v=vs.110%29.aspx). Are you calling the Dispose Method on the Process instance when you are done with it? Probably not.

But as others have stated, "SHOW THE CODE" and then maybe you will get something useful.
TnTinMn 3-Dec-13 21:21pm View
   
He means letters. The columns contain both numeric and string data.
TnTinMn 3-Dec-13 21:19pm View
   
Try add IMEX=1 to the Extended Properties part of your connection string. That tells it that your columns can have mixed data types; i.e. String and Integer.
TnTinMn 3-Dec-13 20:40pm View
   
Does each grouping of buttons, textbox, and labels maintain the same relative position to each other? If so, consider creating a UserControl that contains each of these items and write your logic once into that UserControl. Then you can add this UserControl to your form and they will all behave according to the same logic.
TnTinMn 1-Dec-13 19:03pm View
   
The original code handles conversions between System.Drawing.Color and HTMLColor incorrectly in a few places. You would need to either contact the author to correct it or download the source code and edit it yourself. I found two places where the code is incorrect; the first is the BodyBackgroundColor property and the second is the SetBackgroundColor method. There may be others. The corrected code is as follows:

public Color BodyBackgroundColor
{
get
{
if (doc.body != null && doc.body.style != null && doc.body.style.backgroundColor != null)
return ColorTranslator.FromHtml(doc.body.style.backgroundColor.ToString()); // ConvertToColor(doc.body.style.backgroundColor.ToString());
return Color.White;
}
set
{
if (ReadyState == ReadyState.Complete)
{
if (doc.body != null && doc.body.style != null)
{
//string colorstr =
// string.Format("#{0:X2}{1:X2}{2:X2}", value.R, value.G, value.B);
doc.body.style.backgroundColor = ColorTranslator.ToHtml(value); //colorstr;
}
}
}
}




private void SetBackgroundColor(Color value)
{
if (webBrowser1.Document != null &&
webBrowser1.Document.Body != null)
webBrowser1.Document.Body.Style =
string.Format("background-color: {0}", ColorTranslator.ToHtml(value)); // value.Name
}

TnTinMn 29-Nov-13 10:55am View
   
I have revised the code to include using the Cache. Be advised that this is my first attempt at a WebForm any more complex than "Hello World", so I may not be handling this correctly. :)

I see no need to store a sorted version of the dataset unless it is a performance issue with a WebForm. If that is the case, you could replace the DataTable with the sorted version by creating a table from the DataView (DataView.ToTable()), delete the existing table from the DataSet, and finally adding the new Table to the DataSet.

TnTinMn 26-Nov-13 22:41pm View
   
I am not understanding what your goal is.

"The UITypeEditor is a modal dialog and should open as a child dialog of my application."

Do you mean that you what to display editorFrm while the application is running?
TnTinMn 26-Nov-13 18:40pm View
   
Which line is is indicated as having the error.

If I had to guess, it would be the LINQ statement.

You are using an antiquated syntax in that statement to index the default property of "SF".

SF!Model could be the same as SF.Item("Model"); typically, the default property is named "Item".
TnTinMn 22-Nov-13 0:50am View
   
Is your application 32 bit running on a 64 bit OS?
If so, check: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon
for the changes.

Edit: If 64 bit OS and 32 bit application
For .Net 4.0 and above:
Dim myReg As RegistryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)

For .Net 3.5 and below, see: http://www.roelvanlisdonk.nl/?p=915
TnTinMn 18-Nov-13 23:31pm View
   
Instead of trying to use a VB6 control with code that appears to be based on this(http://msdn.microsoft.com/en-us/library/aa733709%28v=vs.60%29.aspx), why not use the .Net libraries instead? For example code, see: http://msdn.microsoft.com/en-us/library/w89fhyex%28v=vs.110%29.aspx
TnTinMn 18-Nov-13 21:20pm View
   
Thanks. :)

I should have messed with his mind and given him the keyboard shortcut method.
cntl-space and then Alt-HOI (this works for 2007 "and above I think").

TnTinMn 18-Nov-13 12:33pm View
   
Even simpler than that,
1. Go to top of sheet.
2. Hover cursor over right edge of column header until cursor becomes a bar with two arrows on a side.
3. Double-Click to autosize column.
:)

TnTinMn 18-Nov-13 11:11am View
   
I do not believe that you can post an image, but you could upload(like to SkyDrive or whatever) and post the link.
TnTinMn 18-Nov-13 10:53am View
   
I am not sure that I understand your issue. If the cells to the right of cell are empty, then the text will automatically overflow.
You could also merge several cells together. Select the cells, right-click->Format Cells->Select Alignment Tab->Check Merge Cells under "Text Control" heading

In case you don't know, you can also have multi-line cells. Use alt-Enter to break up the lines.
TnTinMn 13-Nov-13 14:42pm View
   
Have you defined the "ar-KW" resource file? Have you written the code to apply the resource file?
TnTinMn 12-Nov-13 13:52pm View
   
How to you fill the DataGridView with values? Please show your code.

You could use the the DataGridView.CellEndEdit event to correct the format, but that is a hack that does not address the underlying issuem that I suspect is that you are filling a column that should be a numeric type with strings.
TnTinMn 11-Nov-13 19:43pm View
   
Why re-invent?
http://www.bing.com/search?q=multicolumn+combobox+codeproject&qs=n&form=QBRE&pq=multicolumn+combobox+codeproject&sc=1-32&sp=-1&sk=&cvid=f1a803ca34384d9bbc8a5a21863c33be

You have several to choose from.
TnTinMn 10-Nov-13 21:46pm View
   
In your method GoToSheets, you define as local copy of xlApp. In the method closeApp, you are using a non-local xlApp definition.

Try commenting out: Dim xlApp As Excel.Application, in GoToSheets.
TnTinMn 2-Nov-13 11:39am View
   
VS Menu: Data->Add New Data Source. Select Database, click next. Click New Connection, Click Change; Select "Microsoft Sql Server Compact x.y(x & y depend on version), Click Ok. Select either Create or Browser to existing database.

After that I can not offer much info as you have not stated what you are trying to do nor have you indicated what problems you have encountered.

If you wish to write all the code yourself, just add a project reference to System.Data.SqlServerCe and then look up the documentation on how to proceed.

http://msdn.microsoft.com/en-us/library/system.data.sqlserverce%28v=vs.100%29.aspx
TnTinMn 2-Nov-13 0:46am View
   
A good place to start is with documentation,
http://msdn.microsoft.com/en-us/library/zzh9ha57%28v=vs.90%29.aspx
Have fun!
TnTinMn 2-Nov-13 0:37am View
   
That is it pretty much for the simplest usage. You could add other code in the "Set" for validation or some other purpose, but it is not necessary. .Net uses properties as hook point in the code for things like databinding.
TnTinMn 12-Oct-13 10:15am View
   
What do you mean by "it changes every column to wrap""? All that property does is allow the row to set its height based on the tallest cell in the row. It does not change the style settings of any column. The default cell alignment is centered, if you prefer the other columns to show their content at the top of the cell, set their DefaultCellStyle.Alignment property to System.Windows.Forms.DataGridViewContentAlignment.TopCenter.

Per your request, I will post my comment as a solution so you can close out this thread.


TnTinMn 11-Oct-13 23:17pm View
   
I'm not sure why that did not appear to work for you. Have you set the AutoSizeRowsMode property?

DataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
TnTinMn 10-Oct-13 22:55pm View
   
"The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar." means that the string value that you are passing an invalid datetime string to the Date.Parse() method. The only way that I could reproduce that specific error message is with an invalid time component.

ie: "2/3/2013 30:00" - hours cannot be greater then 23.

Verify what you retrieving from the datareader (dr("something")).
TnTinMn 4-Sep-13 21:04pm View
   
"In the example you posted, it appears that you are adding values to a data table to view."

Not exactly, what I was trying to demonstrate was how to use a column with a boolean expression that would be the criteria that you store in the database. Look at the the string constants that I defined "xx_validator". You would store these string value in your database and then apply them as the column expression in the datatable. The datatable class will evaluate them based on the data.

"A user Must be able to add new formulas to the database and my .net application must be able to read them and use the formulas to determine a value. That value will be checked to see if it falls within a pre-specified Min-Max range that is contained somewhere in the formula."

I would suggest that your create an expression editor that controls how this information is entered. Then your program can translate it into a valid expression to evaluate.
Take a look at: http://www.codeproject.com/Articles/90589/Visual-Expression-Builder-for-Dynamic-Linq
for some ideas on how you could lay this out.
TnTinMn 4-Sep-13 21:03pm View
   
Deleted
"In the example you posted, it appears that you are adding values to a data table to view."

Not exactly, what I was trying to demonstrate was how to use a column with a boolean expression that would be the criteria that you store in the database. Look at the the string constants that I defined "xx_validator". You would store these string value in your database and then apply them as the column expression in the datatable. The datatable class will evaluate them based on the data.

"A user Must be able to add new formulas to the database and my .net application must be able to read them and use the formulas to determine a value. That value will be checked to see if it falls within a pre-specified Min-Max range that is contained somewhere in the formula."

I would suggest that your create an expression editor that controls how this information is entered. Then your program can translate it into a valid expression to evaluate. Take a look at:

http://www.codeproject.com/Articles/90589/Visual-Expression-Builder-for-Dynamic-Linq

for so ideas on how you could lay this out.
TnTinMn 14-Aug-13 12:30pm View
   
Two things.
First it is best to remove the empty rows from the underlying data source (a datatable?).

Second, you can not modify the Rows collection while enumerating it. Instead use For-Next or Do-While loop to loop through the Rows from last to first and remove the empty rows.
TnTinMn 2-Jul-13 11:04am View
   
That code fragment looks like it is from an MS Access macro, but that is only an educated guess. You should state the context of your code.

Assuming that it is MS Access VBA, then that method will delete the table "tbl_name" from the database (see: http://msdn.microsoft.com/en-us/library/office/ff197376.aspx).

Therefore your question should have been: "What is the procedure to delete a MS Access table using VB.Net?".
TnTinMn 30-Jun-13 23:20pm View
   
+5E99999999999999999999999999999999999999 if I could.
TnTinMn 21-Jun-13 21:33pm View
   
I hope that you realize that this method does not prevent the user from using the keyboard to enter the cell and change it's value. You may want to consider using the cell enter event. You may also want to consider using some method other thane a messagebox to notify the user. Messageboxes can become annoying really quick. Possibly a tooltip placed above the cell would be less obtrusive.
TnTinMn 14-Jun-13 18:11pm View
   
Take a look at the alternative code I just posted above.
TnTinMn 13-Jun-13 20:05pm View
   
To use you datasets, you set the DataSource property just like you originally did. To use two columns as a header cell, you need to determine a way to combine the two values as a format string and assign that to HeaderCell.Value in the RowPrePaintEvent. You would also need to set those two column's Visible property to false.
TnTinMn 7-Jun-13 23:32pm View
   
Your Timer.Tick event handler is not wired up.
Either add:
AddHandler Timer1.Tick, AddressOf Timer1_Tick
to the Form1_Load event handler or change:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
to:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
TnTinMn 7-Jun-13 9:05am View
   
Sure. Can I supersize the order for you as well?
TnTinMn 7-Jun-13 8:44am View
   
Do you want fries with your order?
TnTinMn 6-Jun-13 20:10pm View
   
Sorry, but I know nothing about this API.
You may get a response by posting a new detailed question.

Have you tried: https://developers.google.com/maps/

Also found this: Google Maps API for .NET
http://gmaps.codeplex.com/

You may find some hints in looking at that code.
TnTinMn 1-Jun-13 23:11pm View
   
Understood, and for what it is worth have another gratuitous +5 for your integrity. It frustrates me seeing so many supposed solutions that are nothing more than comments from those who should know and act better.
TnTinMn 1-Jun-13 20:59pm View
   
I wish you would have posted this comment as a solution so that I could have given you a +5. :)
TnTinMn 30-May-13 17:33pm View
   
Follow the advice in Sergey's solution.

I will try explain why your code logic is failing.

You are trying to use the Select-Blocklock with an If-Block like syntax and testing a boolean expression. This is just wrong and will not work.

x = Int(1 + (Rnd() * 6)) does not assign the value to the right of the equal sign to X, but tests if the left side equals the right side in the Select Case statement.

Select Case x = Int(1 + (Rnd() * 6))
Case x = 1
frmGame.UserPaddle.BackColor = Colors(1)
Case x = 2
frmGame.UserPaddle.BackColor = Colors(2)
Case x = 3
....
End Select

is equivalent to:

Select Case False
Case False
frmGame.UserPaddle.BackColor = Colors(1)
Case False
frmGame.UserPaddle.BackColor = Colors(2)
Case False
....
End Select

The reason for this is that X has a value of zero, so x = Int(1 + (Rnd() * 6)) is the same as (0 = Int(1 + (Rnd() * 6))). The right side of the equality test can never be less than 1, so it will always evaluate to False. The select clause finds the first match for False and executes those statements. Hence you will always assign the Red as the color.

Please read the documentation for Select Case blocks.

http://msdn.microsoft.com/en-us/library/cy37t14y.aspx
TnTinMn 27-May-13 20:33pm View
   
Assuming that by "dropdown" you mean a ComboBox dropdown list, why must the image be located beneath it? Why not next to the ComboxBox's edit box? It will be much easier to achieve this. Also, the so-called drop-down can also be a drop-up if in dropping down, it will extend past the bottom of the screen.
TnTinMn 22-May-13 19:30pm View
   
Cool!. Time for the happy dance.
http://3.bp.blogspot.com/_Ty55Ed2OdlE/TPpTlPHJAzI/AAAAAAAAAQQ/tQkMY56I1co/s1600/chAnimated.gif
TnTinMn 19-May-13 2:11am View
   
Do you mean "show all four quadrants in a Cartesian chart" as opposed to "show all four coordinates ( xy, x-y, -xy, -x-y ) on a point chart"?
TnTinMn 17-May-13 20:52pm View
   
"The 4 digit operator number returns an error of Index was outside the bounds of the array when it gets to this statement:

Dim gvMgr_row As System.Data.DataRow = gvMgr_originalDataTable.Select(String.Format("op_num = {0}", currentID))(0)"

The reason for the index out of bounds error is that this select statement is not returning any rows. You need to determine the reason for this.

Since currentID is computed:

currentID = Convert.ToInt32(gvMgrData.DataKeys(r.RowIndex).Value)

Verify that currentID is what you expect it to be.

Change: Dim gvMgr_row As System.Data.DataRow = gvMgr_originalDataTable.Select(String.Format("op_num = {0}", currentID))(0)

To:

Dim gvMgr_row As System.Data.DataRow

Try
gvMgr_row=gvMgr_originalDataTable.Select(String.Format("op_num = {0}", currentID))(0)
Catch ex As Exception
dim cid as object = gvMgrData.DataKeys(r.RowIndex).Value
Stop
End Try

This will stop the debugger and allow you to inspect the variables to see what is going on by hovering the mouse pointer over the variable name.

The above will not solve your problem, but it will allow you to investigate possible causes.
TnTinMn 13-May-13 22:42pm View
   
Reason for my vote of 5 \n Actually 4.5 = 5 (for parody) - 0.5 (for having "and" in string)

I seem to remember from long ago that we were taught that "and" was for the fractional part of a number.
TnTinMn 6-May-13 19:30pm View
   
Could you please elaborate on exactly what you mean by “I want to be able to show the user which character in the cell the cursor is currently on.”?

You have referenced an article showing how to use the EditingControlShowing event that implies you want to do this while editing the cell, but at that point you would have the textbox caret to indicate position.

Or do you want some type of automatic highlightly of the character the mouse pointer is over when not in edit mode?
TnTinMn 5-May-13 21:50pm View
   
Since you are receiving the error message "Incorrect syntax near 'System'", I suspect that txtFname, txtLname, etc. are textboxes. The implict conversion that C# does in string concatenation is converting each of those to "System.Windows.Forms.TextBox, Text: ".

Use textboxname.Text to retrieve the Text property. But as others have noted, this is not a good way to develop a query string to start with. Follow their advice.
TnTinMn 5-May-13 21:33pm View
   
Without actually seeing your data and code it is not possible to to understand the reason for the NullReference exception.

It is possible to filter out null values though.

Give this a try. It also verifies that the value is a string.

private void listBox1_SelectedValueChanged(object sender, EventArgs e)
{
if (listBox1.SelectedValue != null && listBox1.SelectedValue is string)
{
webBrowser1.Navigate(listBox1.SelectedValue.ToString());
}
}
TnTinMn 5-May-13 19:37pm View
   
Please show your code that populates the listbox. If you just added string items to it, your code should be working.

If you set the listbox datasource and valuemember properties, you would use:

WebBrowser1.Navigate(listBox1.SelectedValue.ToString());
TnTinMn 1-May-13 16:50pm View
   
What do you mean by "my own properties"? Do you want to hide the inherited properties from the grid? If, so you can implement System.ComponentModel.ICustomTypeDescriptor on you class and modify the GetProperties functions to return a only those properties you want to show.

If you want an example, just ask.
TnTinMn 30-Apr-13 19:03pm View
   
Just a guess here, but maybe it is due to the Floor function. Perhaps use Ceiling if negative?

Floor(2.7) = 2 whereas Floor(-2.7) = -3
TnTinMn 30-Apr-13 14:56pm View
   
Hi, this is not my thing, but with a quick search I found this:

http://www.xmlforasp.net/codeSection.aspx?csID=42[^]

Perhaps, it will work for you.
TnTinMn 27-Apr-13 21:03pm View
   
If you expect any meaningful responses, you are going to have to show your DataUtility class. In particular, the GetDataTable method.
TnTinMn 26-Apr-13 17:40pm View
   
It's just something that I noticed once after looking over a few of the those sites, that various forums suddenly get a lot of questions on how to code the required tasks. Maybe its a coincidence, but whenever I see a lot of posts on a topic that seems beyond a school topic, I take a look and often someone had posted a job with that requirement.

I seen something similarly fishy here a while ago, where it started off that the poster wrote the program for a friend and it changed to client at the end of the post.
TnTinMn 26-Apr-13 17:31pm View
   
Deleted
The Jet provider is 32-bit only. So if you know that you installed it, make sure your program is set to compile as x86.
TnTinMn 26-Apr-13 17:05pm View
   
At best students. At worst all bidders for the same rent-a-coder project. :(
TnTinMn 26-Apr-13 14:25pm View
   
In the title - "The conversion of a varchar data type to a datetime data type resulted in an out-of-range value"

That is the error message received when a default parameter is used along with the AddWithValue method with a string value of "01/01/0001" and the destination field is datetime.
TnTinMn 23-Apr-13 21:53pm View
   
What has you done so far? No one is going to write this application for you.

Here is a hint: First retrieve a table of Tables in the DB. This is accessed using "SELECT * FROM INFORMATION_SCHEMA.TABLES". Then you can retrieve each Table in the DB and display it's contents.
TnTinMn 1-Mar-13 15:29pm View
   
Go to the Project Properties page. On the Application Tab Copy the RootNamespace field and substitute that for WpfApplication1. You may have to issue a rebuild to get it to take. I had a few isssues also when I typed it in as well. Since it looks like you are using VS2012, it looks like they still have not made it any friendlier to use than it is in VS2008.
TnTinMn 1-Mar-13 15:22pm View
   
Go to the Project properties page (double-click on "My Project" in the solution explorer) and the to the "My Extensions" tab. Click on the "Add Extension" button and then select "WPF My extension". That should clear up the problem.
TnTinMn 1-Mar-13 15:21pm View
   
Deleted
Go to the Project properties page (double-click on "My Project" in the solution explorer) and the to the "My Extensions" tab. Click on the "Add Extension" button and then select "WPF My extension". That should clear up the problem.
TnTinMn 28-Feb-13 21:29pm View
   
I was bored so I thought I would give it a try. I'm still new to WPF.
Besides, I found many comments that doing a filtered ComboBox was pain and I like a challenge. :)

I replaced the code in my previous post to give what I think you are looking for. I now agree with a comment that I found that WPF can hurt your brain, :)) WinForms is so much easier to to achieve this with. At least I didn't give you a WinForm control and tell you to host it in WPF.
TnTinMn 27-Feb-13 12:22pm View
   
Not sure if I understand you correctly, but you can make an ordered copy based on my previous example with this.

Dim dt2 As DataTable = dt.Clone()
For Each dvr As DataRowView In dt.DefaultView
dt2.ImportRow(dvr.Row)
Next