15,744,607 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Javascript questions
View C++ questions
View Python questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Trak4Net (Top 61 by date)
Trak4Net
6-Oct-14 16:34pm
View
I don't understand your loop through the datagridview, it looks like you will always get the name that is last in the datagridview. However, typically the SelectionChangeCommitted event is what you want to use instead of SelectedIndexChanged, as usually from my experience the selected item has not committed in the SelectedIndexChanged event, so you will always get the last selected item, not the one you are currently selecting.
Trak4Net
20-Jan-14 14:47pm
View
This may or may not be helpful.
if (filterContext.HttpContext.Request.IsAjaxRequest())
{
}
This should tell you if it is an ajax call and then maybe return some javascript instead of a redirect to handle redirecting the entire site.
I also read that if you need to determine if it is a partialview you can use OnActionExecuted and see if the filterContext.result is a partialviewresult ??
Hope this is helpful.
Trak4Net
20-Jan-14 14:37pm
View
There are many questions that come to mind. In the most generic sense you provide a connection string from App.config or other runtime configurable place, never hard code connection string.
Is the database going to be accessed by multiple clients, do the clients need to know about changes made by other clients? If the database is local for some clients, does it need to synchronize with the server database such as an offline client?
Trak4Net
2-Nov-13 15:03pm
View
I don't think the codec is supported by windows. You will likely need a third party SDK such as http://www.leadtools.com/help/leadtools/v18/dh/to/leadtools.topics.leadtools~l.topics.fileformatsecw.html
Trak4Net
2-Nov-13 14:53pm
View
I guess I misunderstood what you were looking for. It looks like you have it figured out from the other solution. If not let me know I will try and help out.
Trak4Net
31-Oct-13 20:25pm
View
Just curious... wouldn't you want to redirect them to the login page? What if the user has lost authentication then they get 404 not found and think there is an issue.
Anyways, I would think you could just redirect to your fancy 404.aspx page instead of setting the response code to 404? I am sure you are just trying to find out why and unfortunately I don't know but just curious.
Trak4Net
23-Aug-13 14:56pm
View
Have you tried New SolidBrush(Color.FromArgb(A,R,G,B))?
Trak4Net
23-Aug-13 14:47pm
View
You may want to check this out.
http://bobpowell.net/region_from_bitmap.aspx
Trak4Net
23-Aug-13 14:27pm
View
Do you have any stack trace information. I am not familiar with that library so don't know the inner workings of it. Is this where you get the exception " SpyModem.DownloadSatelliteMeasurements(CaptorSonda, Data1, Data2)" ?
Also if you have any code changes that would be helpful if you use the "Improve Question" to show what you have tried. This may be something you just need to work out with the developer of that library though.
Trak4Net
23-Aug-13 14:21pm
View
I don't know the "type" those objects are for sure so it is hard to say. They could be wrapper classes. The poster that used those examples didn't give enough code to show what they are.
Trak4Net
23-Aug-13 14:13pm
View
Do you have any stack trace information? Have you tried executing that same code outside of installer (use a different method than "overrides sub Install") just as a test to see if you get different results?
Trak4Net
23-Aug-13 3:50am
View
Is the term DATABASE anywhere in your SQL scripts that aren't shown? Either a use statement or anything?
Trak4Net
23-Aug-13 3:46am
View
I see. As far as your code, I could be mistaken but I believe args[0] will be the executing file itself. I might be thinking of something else though. I would definitely add the logging and you should be able to determine that right away.
Trak4Net
23-Aug-13 3:38am
View
Thank you!
Trak4Net
23-Aug-13 3:36am
View
So the update command is only used to push modified data back to the original datasource SQL etc. in your case it is excel. I found this link if that is one of the things you are trying to accomplish. http://blogs.msdn.com/b/spike/archive/2008/10/29/how-to-update-an-excel-worksheet-using-dataset-and-the-oledbdataadapter.aspx
For refreshing the datagridview I found this blog that discusses the issues with .Refresh
http://social.msdn.microsoft.com/Forums/windows/en-US/18a9762e-ac67-48a7-a372-55307fe344f3/how-do-you-refresh-data-bound-to-a-datagridview
Hope that helps you out.
Trak4Net
22-Aug-13 18:02pm
View
I would be willing to bet that SpyModem is trying to open the port but it is already opened by spycom, not sure if you have them tied together elsewhere, but with the given sample that would be my first place to look.
Trak4Net
22-Aug-13 17:55pm
View
Maybe you should do a check to see if strDBName is empty. It might be possible that the Install method is getting called twice and the Context does not contain the parameters you are looking for.
Trak4Net
22-Aug-13 17:21pm
View
That is Linq. I would really recommend getting a book or going through some tutorials on it!
It is basically the below example simplified, sometimes saving alot of lines of code. Linq is very powerful and useful for a lot of objects that inherit IEnumerable. I mostly code in C# and Linq with lambda expressions are so much easier for me than in VB. I hope the example below helps you understand the Linq I used, but again, if you aren't familiar with Linq I would recommend researching it when you can. I didn't test my code below just typing it into the comment box so hopefully it is correct :)
<pre lang="vb">
Public Function GetAllStreets() As IEnumerable(Of Street)
'collection to store Street object that matches 30MPS
Dim streetsResult As New List(Of Street)
'Iterate collection and look for Street that has 30MPS and add to our temp collection
For Each _street As Street in _streets
If (_street.MPS = 30) Then
streetResults.Add(_street)
End If
Next
Return streetResults.AsEnumerable(Of Street) 'return our collection as IEnumerable(Of Street)
End Function
</pre>
Trak4Net
22-Aug-13 15:38pm
View
On a side note, once you get logging determined you may want to look into threading also. Your service the way it is in your example will start > zip > stop. There is no thread keeping your service running. Logic like this should not be in the onstart method. The onstart method should be used to initialize your thread that will handle the continuous processing. Although, maybe you have another program that just starts this service when there are files to be zipped? Not sure why you would use a service if that is the case.
Trak4Net
22-Aug-13 13:42pm
View
Not sure I understand. Are you trying to find out what Type "names" would be in the For Each loop? And are you giving examples of possible answers at the bottom or are you wanting to know what all of those Types are?
Trak4Net
22-Aug-13 13:38pm
View
Sounds like you need a way to find the street again so you can add more houses? I would recommend setting up some linq queries to find if street already exists.
Here is some sample though not exactly what you are trying to do.
<pre>
Public Class SubDivision
Dim _streets As New List(Of Street)
'get list of all streets where MPS is 30
Public Function GetAllStreetsFor30MPS() As IEnumerable(Of Street)
Return (From s In _streets Where s.MPS = 30 Select s)
End Function
Public Property Streets As List(Of Street)
Get
Return _streets
End Get
Friend Set(value As List(Of Street))
_streets = value
End Set
End Property
Public Function AddStreet(ByVal strt As Street) As Street
_streets.Add(strt)
Return strt
End Function
End Class
Public Class Street
Public Property MPS As Integer
Dim _houses As New List(Of House)
Public Property Houses As List(Of House)
Get
Return _houses
End Get
Friend Set(value As List(Of House))
_houses = value
End Set
End Property
Public Function AddHouse(ByVal hs As House) As House
_houses.Add(hs)
Return hs
End Function
End Class
Public Class House
Public Property Color As String
Public Property Number As Integer
End Class
</pre>
Trak4Net
22-Aug-13 12:03pm
View
Are you getting no value or are you not getting the value you expected? From your example code phonelist[2] should equal Ehab. If you are getting no value then I would re-evaluate your variable for phonelist becase "phoneList" and "phonelist" are different variables (notice the casing) which I assumed was a typo here, but could be a typo in your code also.
Trak4Net
30-Jul-13 20:21pm
View
If you are pointing to a local file such as a help file that is accessible from the iframe you may need to use the "file" protocol instead of "http" so the using "UL UL ALBAB"'s example it would be something like this
string filePath = Server.MapPath("admit.pdf");
myframe.Attributes.Add("src", "file:///" + filePath.ToString());
note: I did not test this and you may need to deal with converting backslash (\) to forward slash(/) of filePath.
Trak4Net
2-Aug-12 13:20pm
View
Does the exception have an inner exception? I read someone else was getting this error and the inner exception had to do with password complexity policies, password history etc.
Trak4Net
31-Jul-12 2:03am
View
The url cannot be to the path local to the web server. You would either need to store the pdf's in a subdirectory that is available so the url would be something like "http://my.hosted.com/Journal/admit.pdf" otherwise you will need to create a page that will read the file and write the file contents to the response stream so you would end up setting your url to something that has the file name or id in the query "http://my.hosted.com/viewJournal.aspx?fid=admit.pdf"
For the later do a google on something like this "Write pdf to response stream"
Trak4Net
31-Jul-12 1:56am
View
Glad I could help!
Trak4Net
30-Jul-12 4:18am
View
You will probably want to change your logic a little. If you clear the autocomplete source when the text box is empty and only re-initialize the autocomplete source with your query when TBOwner.Text.Length = 1, if the user keeps typing the auto complete source will auto filter as they type.
I think there is a timing issue with changing the auto complete source while it is trying to filter in background.
Something along the lines of this (in a simplified example)
Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text.Length = 1 Then
Dim col As New AutoCompleteStringCollection()
col.Add("Seven")
col.Add("Sentinal")
col.Add("Seventy")
col.Add("Sensorship")
TextBox1.AutoCompleteCustomSource = col
TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest
TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
ElseIf TextBox1.Text.Length = 0 Then
TextBox1.AutoCompleteMode = AutoCompleteMode.None
TextBox1.AutoCompleteSource = AutoCompleteSource.None
TextBox1.AutoCompleteCustomSource = Nothing
End If
End Sub
Trak4Net
28-Jul-12 16:04pm
View
Your procedure parameters do not have default values except for statementType so the must be populated even if you set null values. If you have control over this procedure and you don't want to have to code those extra parameters then change your stored procedure to have default values.
Trak4Net
24-Jul-12 15:31pm
View
You will be way better off using streamreader and some regular expressions to parse out the columns. If you have control of the source data and can be sure you will never have a comma within your data value then you could skip the regex and just do a string.split.
Once upon a time I went down the road of the Oledbconnection and I had nothing but issues when using on different systems, different data files. I developed my own flat file reader that has all of the functionality I needed using streamreader and regex.
Trak4Net
21-Jul-12 16:48pm
View
I want you to understand I try to avoid any possible legal issues, most of the time when dealing with copying copyrighted items you run into legal issues so I avoid them. With that being said, if you are at a point where you are struggling with any particular area of C# I would recommend using the discussion forums. Also, there are a lot of good articles from simple to complicated on this site alone. Good luck to you.
Trak4Net
21-Jul-12 16:17pm
View
I am not a lawyer, but if you are interested you can read all about it here
http://www.copyright.gov/
Trak4Net
20-Jul-12 15:14pm
View
Sorry, in the USA it is illegal.
Trak4Net
20-Jul-12 15:10pm
View
Is the print occuring from within your own application or are you wanting to integrate with the print spooler/print processor? If you want to integrate with the print processor I would be inclined to think C++ would be a better fit than C#. I believe you would need the windows driver developer kit and write your own print processor.
This looks like a good article, depending on your needs.
http://www.codeproject.com/Articles/8916/Printing-Architecture
Trak4Net
18-Jul-12 17:57pm
View
If you can give more detail to your design plan and what you would like to see happen that would be helpful. My first thought is why? If the user is logged into the computer they are already authenticated. Are you trying to limit allowed users by comparing to user list stored in your application somewhere? Are you trying to lock your application after a period of no activity and hence require re-authenticaiton to unlock? There are many design scenarios and different ways to "validate" windows login, it all depends on what your design requires, so definitely give more in depth detail to what you are looking for.
Trak4Net
18-Jul-12 5:09am
View
Just tested again with bitmap that has different height/width values and now is correct with my v2 correction of y, x variables.
Trak4Net
18-Jul-12 4:26am
View
Ok, I will post a full working example shortly. I have already done similar in C# so will create a test app in VB and post soon, with proven results.
Trak4Net
18-Jul-12 0:22am
View
I don't see where arrLIst1 is declared. More than likely the array arrLIst1 does not have 3 items in it to assign a value to. In your code example you are assigning value to arrLIst1 index 0 and arrLIst1 index 2 (nothing assigned to arrLIst1 index 1). Not sure if maybe you are attempting to create a multidimensional array?
Trak4Net
17-Jul-12 14:51pm
View
Did you look at the link provided above for cmd.exe parameters?
If you want to see the command window to watch the output of your java.exe look at using these parameters
Options
/C Run Command and then terminate
/K Run Command and then return to the CMD prompt.
This is useful for testing, to examine variables
Command : The command, program or batch script to be run.
This can even be several commands separated with '&'
(the whole should also be surrounded by "quotes")
Trak4Net
17-Jul-12 14:42pm
View
thams, just curious if your issue is now resolved? I didn't get a chance to test this, I put that code together in notepad since I dind't have Visual Studio handy when I made the edit.
Trak4Net
16-Jul-12 0:05am
View
Does it need to be in the Dispose method or would it be fine to use it in the form_closing event?
Trak4Net
15-Jul-12 13:36pm
View
It looks like you have all of the code ready to do that. Have you tried the code you show and got errors? If you use "stringData" to parse IP address does it fail? are you trying to figure out how to only listen to messages from that IP address?
Trak4Net
14-Jul-12 18:10pm
View
If you are including processhelper.dll with your exe then verify that processhelper.dll does not depend on another dll that is not included. As recommended below if you create a setup project you'll see right away all of the dependent dll's listed in your setup project.
Trak4Net
14-Jul-12 13:22pm
View
Glad you got it figured out.
Trak4Net
14-Jul-12 6:04am
View
Are you adding handler to button click? It sounds like code continues to add handler somewhere.
Trak4Net
13-Jul-12 20:31pm
View
Thank you, I see your answer now. I appreciate positive feedback to my answers.
Trak4Net
13-Jul-12 15:37pm
View
From your error message it looks like PCSMVC.Country[] is an array. It looks like you are trying to use it as if it is an object. What is the definition for PCSMVC.Country ? Is it a collection or a single object with properties.
Also, you initialize your list and try accessing first object in list when you haven't added anything to the list yet, I would imagine if it reached that line of code you would get an index out of range error, since the list contains no items.
public List<pcsmvc.country> GetCountry()
{
List<pcsmvc.country> lst = new List<pcsmvc.country>();
//should add an object of pcsmvc.country (can initialize properties also)
lst.Add(new pcsmvc.country() { CountryName = "India" });
return lst;
}
or you can do it this way...
public List<pcsmvc.country> GetCountry()
{
List<pcsmvc.country> lst = new List<pcsmvc.country>();
//should add an object of pcsmvc.country
lst.Add(new pcsmvc.country());
//now the list contains the object and you can access it
lst[0].CountryName = "India";
return lst;
}
Trak4Net
13-Jul-12 14:00pm
View
Can you give an example of how you detect when a device is connected?
If you are using windproc you can look at this article. You should be able to evaluate the device type from the structure.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363246(v=vs.85).aspx
Trak4Net
13-Jul-12 1:39am
View
Is your requirement that the 10 files are to be grouped together or is each individual file processed as its own and you just want to keep processing while the queue has items and be able to continue to add to the queue?
Trak4Net
12-Jul-12 13:58pm
View
In the .NET components tab there is a browse button near bottom. Choose that and find where you downloaded the TAO dll's to. Choose the file TAO.Platform.Windows.dll, now you will have the SimpleOpenGLControl in your items to choose from. I tested it, you still need the controlname.InitializeContexts() in the form load. If I were you I would research on the TAO SDK for more information on how it should be implemented.
Also, check out these links (especially the latter of the two if you haven't already)
http://stackoverflow.com/questions/2795442/is-the-tao-framework-dead
http://www.opentk.com/
Trak4Net
11-Jul-12 10:40am
View
Is this a windows forms application? Usually when I am writing an application that will not have any significant UI I set the startup form with the following properties: WindowsState == Minimized, ShowinTaskBar == false
I add a notify icon to the startup form. My processing class will be initialized from the form load and have events that the form can attach to and use to determine the state of the notify icon. Then I will adjust the icon, text, show a balloon tip based on the event. I never dispose of or initialize a new notify icon, always using the same one throughout the life of the program. I typically assign a context menu to the notify icon to handle exiting the program or showing a configuration UI based on the application.
Trak4Net
11-Jul-12 3:26am
View
As I mentioned I am not familiar with the openGL libraries. The control has size and location properties so you can set it with code or you might even be able to add the controls to the toolbox in visual studios and drag them onto the form. If you can then you should have access to size and location in the properties window, as well as all of the events available.
I just short cutted it and programmatically added the control.
If you add the control from the toolbox then you do not need to create a new instance in the form load, you might however need to call the initialize contexts though. If you need an example I would be glad to add one tomorrow.
Trak4Net
11-Jul-12 3:01am
View
I think I might be confused now. Do you want two or more icons showing at a time based on how many modems are connected or do you want a single notify icon to change and reflect when the event of connecting/disconnecting occurs and show the balloon tip stating what event occured?
Trak4Net
11-Jul-12 0:25am
View
I have not been able to invest as much into learning MVC3 or jQuery so if I am way off I apologize. In your script for the index view you are referencing this $('#cuscreate') which doesn't exist in the index view. Maybe I am mistaken but doesn't that html element need to exist for jQuery to access it and push the results into that element?
Trak4Net
10-Jul-12 13:48pm
View
I agree, the gl initialized in Form1_Load is within the scope of the form1_load and goes out of scope after form1_load exits. I don't know how gl_Paint would even get called unless that happens from gl.InitializeContexts, but I don't see a handler attached in the form1_load so don't know how that could even happen. As stated by Wes the variable Gl (remember C# is case sensitive) is not declared in your code sample, unless it is a static object in one of the using namespaces.
Trak4Net
10-Jul-12 13:36pm
View
Have a look at this...
http://msdn.microsoft.com/en-us/library/7d83bc18(v=vs.80).aspx
Trak4Net
10-Jul-12 2:16am
View
Thanks for the down vote. Guess I shouldn't have tried to interpret the unclear question.
Trak4Net
10-Jul-12 2:10am
View
Ok, the WaitForInputIdle only works if the exe has a GUI or message pump. Probably the best bet is to have a controlled loop and perform the method from solution 1 above.
Trak4Net
9-Jul-12 14:27pm
View
The cache setting is what will resolve the issue. As stated it is the browser reloading the cached content. Setting the cache expiration or dissallowing the cache will be what you want to do. You do not have to do it in a master page you can do it in a per page situation so if only an admin page is what you want to keep from caching you can set the cache settings for that page.
Trak4Net
9-Jul-12 13:48pm
View
"same box" same computer/server If the service is hosted with the website.
The web.config is a protected file. You can't just make a webrequest to a website for its web.config file. So it is not possible, unless you are running both the service and the website together on the same server. I would definitely recommend using a database over trying to read a config file from another website/program. Depending on what you are building you might want to think of adding a service call that the individual websites can push there settings with some sort of website identifier for the service to store the settings. This would be the way to go if you ever needed the service hosted away from the website hosting.
Trak4Net
9-Jul-12 13:40pm
View
If you can give a code example of how you are saving the files to the file system and how you are loading them into the attachment. A common mistake is using the method System.IO.File.Open which returns a System.IO.FileStream and not closing the returned stream. While the thread that made the call is still alive and if the returned FileStream has not been closed you will get that exception.
Trak4Net
4-Jul-12 0:59am
View
It looks like you are creating a new label and not referencing one that exists already. Are you adding this label further down the code somewhere? Something like panel1.Controls.Add(LabelUrgent) or Page.Controls.Add(LabelUrgent)?
EDIT:
Are you trying to render the HTML from the LabelUrgent within the button? If that is what you are trying you will need to write a custom button control and handle the html rendering yourself to customize it.
Show More