15,899,124 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 C++ questions
View Javascript questions
View Visual Basic questions
View Python 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 BC @ CV (Top 95 by date)
BC @ CV
5-Mar-13 17:24pm
View
"Premature optimization is the root of all evil" -- DonaldKnuth
In my 10 years as a programmer I have rarely had a serious problem with code that performed too slow and have regularly had headache inducing problems with overly complicated and hard to maintain code. Unless the project requires super optimized performance I always go for the simplest most easy to read solution.
BC @ CV
1-Mar-13 10:52am
View
Actually the Contains() method will return true if there is a partial match.
EXAMPLES
----------------
true: StringToSearch = "This is a string with some text in it.";
TextBox1.Text = "tex";
false: StringToSearch = "This is a string with some text in it.";
TextBox1.Text = "txt";
true: StringToSearch = "Brian Williams";
TextBox1.Text = "Wi";
BC @ CV
28-Feb-13 12:19pm
View
So...you're searching a blank string? O.o
I guess I don't understand what you're doing. All I can tell you is in the code I gave you the if will be true when the text in TextBox1 is found within the StringToSearch.
BC @ CV
28-Feb-13 12:14pm
View
5'd as well, I learned a few things.
BC @ CV
28-Feb-13 11:04am
View
How about
"VB.Net" "Data" "Grid"
"? If you can't effectively research a topic, particularly one with as much material as data presentation, then you are in the wrong business. A software developer has to know how to research and be resourceful.
BC @ CV
28-Feb-13 10:39am
View
Your best bet is to do some Googling. I found this in 5 seconds:
http://vb.net-informations.com/datagridview/vb.net_datagridview_button.htm
BC @ CV
27-Feb-13 15:24pm
View
You should already have System.dll referenced you just need to add: Imports System.IO
BC @ CV
27-Feb-13 13:14pm
View
StreamReader has been available since 2.0:
#region Assembly mscorlib.dll, v2.0.50727
// c:\WINNT\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll#endregion
using System;using System.Runtime.InteropServices;using System.Text;
namespace System.IO{ // Summary:
// Implements a System.IO.TextReader that reads characters from a byte stream
// in a particular encoding. [Serializable] [ComVisible(true)]
public class StreamReader : TextReader......
BC @ CV
27-Feb-13 11:41am
View
Try deploying the dll with the exe.
BC @ CV
27-Feb-13 11:15am
View
Your code sample doesn't show what StringToSearch is, only that you want to check if it contains the string in TextBox1.Text.
BC @ CV
27-Feb-13 9:45am
View
You question is not very clear.
BC @ CV
27-Feb-13 9:36am
View
Yes. You can use bitwise operators to check for bit flags.
Bit Wise Operators
Bit Flag Enums
BC @ CV
27-Feb-13 9:29am
View
If you want an answer your going to need to supply more information...like perhaps what exactly the error message is.
BC @ CV
27-Feb-13 9:26am
View
High Five! Code like this will get you hacked.
holidaydate = "' OR '1' = '1;";
sql = "select * from Tb_Declared_Holidays where Holiday = '" + holidaydate + "'";
BC @ CV
27-Feb-13 9:17am
View
I just pasted your code in my win form and it loads the file names to the combobox perfectly. I don't see any ADO code so can't help you with your database issues. Can you show more code and explain better what you're trying to do?
BC @ CV
26-Feb-13 14:20pm
View
What exactly is your question and why did you list this as VB.Net?
BC @ CV
26-Feb-13 14:13pm
View
Why do you need to import the contents of a word file? Why not just put this in the RDLC to begin with?
BC @ CV
26-Feb-13 14:05pm
View
you could always just add this to a column in your SQL query: GetDate() AS [CurrentDate]
...But why would you want to display the current date in a grid since the entire column would contain the same value?
BC @ CV
25-Feb-13 13:47pm
View
To load BigInteger with a number larger than a long or double you will need to use a byte array. If you use the number class on the
blog
, you can just use a string like so:
Number myBigFatGreekNumber = new Number("3.141592653589793238462643383279502884197169399375105820974944592307816406");
BC @ CV
25-Feb-13 13:01pm
View
If you need whole numbers you could use
this
.
If you need really large floating points you could use
this
.
BC @ CV
25-Feb-13 12:26pm
View
Its not that clear what you want to do. If you are wanting to store what sizes are availble for a specific product you can use two tables. One for products and one to store the sizes as shown below:
Products(
ProductID,
Name
)
Sizes(
SizeID,
ProductID,
SizeCode
)
BC @ CV
22-Feb-13 15:43pm
View
Check the updated solution.
BC @ CV
22-Feb-13 15:13pm
View
Is txtSICCode a string pulled from someTextBox.Text, if not then the problem is that you are using the
Contains
from the
TextBox
object and it is looking through child controls not the text property value. See Solution 3.
BC @ CV
22-Feb-13 15:05pm
View
How about you try building something and if you get stuck on a particular problem you can then ask a specific question and post your code.
BC @ CV
21-Feb-13 9:15am
View
It is best to let the DBMS increment the ID with IDENTITY(1,1). If you then need to return the identity of the newly inserted record you can use @@IDENTITY in your stored proc. Read more
here.
BC @ CV
21-Feb-13 9:12am
View
Deleted
It is best to let the DBMS increment the ID with IDENTITY(1,1). If you then need to return the identity of the newly inserted record you can use @@IDENTITY in your stored proc. Read more
here.
BC @ CV
4-Feb-13 15:51pm
View
Do you really need the formatting (bold, dd-MM-yyyy_hh-mm-ss, etc)? If not just write a CSV file.
BC @ CV
4-Feb-13 15:41pm
View
Well....use a random number generation function such as:
this[^]
to generate the number.
Then set button colors thusly: button1.BackColor = myArrayOfPossibleColors[num];
and text values like so: button2.Content = num;
BC @ CV
4-Feb-13 15:13pm
View
sounds like a homework assignment.
BC @ CV
4-Feb-13 12:56pm
View
Its not that you can't get data via PDF its just going to be a very brittle solution and give you many headaches down the road especially whenever the document/data gets modified. I would investigate
iText
BC @ CV
4-Feb-13 12:50pm
View
So you are trying to read the data from the legacy system by converting what it sends to the printer to a PDF and then reading the PDF? That sounds ridiculous, What is the legacy system? Even screen scraping sounds like a better idea.
BC @ CV
4-Feb-13 12:11pm
View
If possible, I would try to get the data from the legacy system before it goes to the printer and then create a PDF by either using RDLCs or some third party library like itextsharp.
BC @ CV
4-Feb-13 9:17am
View
If VB1-6 hadn't been around there would not be a VB.Net & C# would still be what it is today. VB.Net was created for the sole purpose of retaining the VB6 users. VB1-6 was a good product that fulfilled a need. It made rapid application development in businesses possible to a degree that no other platform did. When I first started coding in VB6 I loved it. It was easy to learn and I could quickly assemble fully functional applications. Anyway, C#, VB, C++, PHP, etc are all just a means to an end.
BC @ CV
4-Feb-13 9:08am
View
As SA explained above its totally hardware dependent. So the best you can do is to Google the name of your printer & PRN. If you need this to work for all printers you are looking at a near impossible feat, you might consider if there is a more reasonable way to accomplish whatever it is you are trying to accomplish. BTW what is the reason for your needing to read a PRN file in a form?
BC @ CV
1-Feb-13 18:06pm
View
It's not clear to me what you're asking, but the main purpose of an interface is to allow for polymorphism.
Interfaces[^]
BC @ CV
1-Feb-13 17:59pm
View
I totally agree. I started in VB6 and when .Net came along I spent about 3 months with VB.Net then dropped it for C# and haven't looked back. The IL maybe the same but C# is the more respected language perhaps because its stricter and because of VB6 bagage. I also prefer the less verbose language since I can scan the code quicker.
BC @ CV
25-Jan-13 16:49pm
View
Doesn't Response.Redirect work? You could also use Server.Transfer.
http://www.developer.com/net/asp/article.php/3299641/ServerTransfer-Vs-ResponseRedirect.htm
[
^
]
BC @ CV
25-Jan-13 16:26pm
View
BTW your XML is invalid. You transposed </persons> & </person>
BC @ CV
25-Jan-13 15:18pm
View
Why? To try to take over the world of course Pinky!
BC @ CV
25-Jan-13 11:45am
View
Nice. Thanks for the compiler tip, I didn't know that.
BC @ CV
25-Jan-13 11:40am
View
No worries. Sometimes it just takes another pair of eyes, ones that haven't been up all night staring at a text editor.
BC @ CV
24-Jan-13 16:40pm
View
ok, lo siento, entonces, no se como ayaudarle, pero... si a menos algunos datos se recibe, Puede que tenga que traducir bytes, ya que es un puerto de serie.
BC @ CV
24-Jan-13 16:12pm
View
Que significa: "con el hw"
BC @ CV
24-Jan-13 14:48pm
View
Well, I can only guess from your error message, "
...Interfaz no compatible...
", that your XML (serialized object) doesn't match the interface of the object that's expected by the WS.
BC @ CV
24-Jan-13 13:47pm
View
Is your XML formated properly?
SOAP
BC @ CV
24-Jan-13 12:22pm
View
Why is there a 10,000 max?
BC @ CV
23-Jan-13 17:41pm
View
Perhaps the service is expecting an XML serialized object. What if instead of sending the class you sent its XML representation. Such as:
"<idcard><usuario>CgUlDSJZvIc=</usuario><Password>/px5j+mfNBc=</Password></idcard>"
BC @ CV
23-Jan-13 15:54pm
View
Why is this voted a 1? This is good code that answers the question. +5
BC @ CV
23-Jan-13 14:03pm
View
Ok... The last I checked 8 + 12 is 20.
BC @ CV
23-Jan-13 13:59pm
View
What is the error you are getting? You do know this code has
nothing
to do with Outlook, right?
BC @ CV
23-Jan-13 13:56pm
View
Where is the textbox txtordertotal? From your image It looks like you are expecting to see this total a cell (row[3], Cell[3]), which of course your code is not doing.
BC @ CV
23-Jan-13 10:54am
View
Thanks SA. I was wondering the same thing.
BC @ CV
18-Jan-13 11:19am
View
Keep in mind multi-threading only speeds up processing if you have multiple CPUs.
BC @ CV
18-Jan-13 10:01am
View
Cool! I didn't know such a thing existed. +5
BC @ CV
18-Jan-13 9:49am
View
You are a very patient guy. +5
BC @ CV
18-Jan-13 9:47am
View
Well, actually I don't get your question. If you are not checking to see if the current time is Saturday at 7pm what are you checking?
BC @ CV
18-Jan-13 9:40am
View
"without using paging...", So you want to just show the top 10 and that's it?
BC @ CV
16-Jan-13 15:46pm
View
You can't change the code behind without re-compiling, but you can change the .aspx page, its just text.
BC @ CV
16-Jan-13 15:24pm
View
This looks like SPAM.
BC @ CV
16-Jan-13 15:22pm
View
If it is a value type you will not be able to return null, but you can return the default value for that type.
BC @ CV
16-Jan-13 15:11pm
View
Is CircleF a value type?
BC @ CV
16-Jan-13 15:00pm
View
WOW! that is one heck of a for statement. Is there a particular reason you're using that syntax?
BC @ CV
16-Jan-13 14:44pm
View
How about showing us your code?
BC @ CV
16-Jan-13 14:36pm
View
Yes indeed. The one stop shopping destination for solving connection conundrums!
BC @ CV
16-Jan-13 13:14pm
View
That's what lists are for.
BC @ CV
16-Jan-13 12:19pm
View
You question isn't clear. Are you asking how to import an Excel file into an Access database?
BC @ CV
15-Jan-13 9:42am
View
Thanks, Correction made.
BC @ CV
14-Jan-13 13:39pm
View
I think
[this^]
is what you're looking for.
BC @ CV
10-Jan-13 11:04am
View
You have to select it first:
app.ActiveWindow.Selection.TextRange.Select();
Read
this
.
BC @ CV
8-Jan-13 9:52am
View
So....
PowerPoint.Application app = slide.Application;
BC @ CV
8-Jan-13 9:50am
View
Really!?
BC @ CV
7-Jan-13 13:35pm
View
When you say, "...doesn't run and go to the debug mode..." do you mean it is a compiled .exe you're running and it throws an un-handled error? If so I would say that is happening because you're trying to parse a non-integer string. You can account for this by int.TryParse or adding an error catch.
BC @ CV
20-Dec-12 12:32pm
View
Of course not!
Why do the work himself when he can just post a question and get back completed
code[^]
.
BC @ CV
20-Dec-12 12:31pm
View
Deleted
Of course not!
Why do the work himself when he can just post a question and get back completed
code
.
BC @ CV
20-Dec-12 12:25pm
View
Excellent blog post. This looking for others to do the work for them without even trying to do it themselves is a phenomena that goes well beyond programming. It sadly seems to be a generation defining characteristic.
BC @ CV
20-Dec-12 11:48am
View
A billion dollhairs. That's awesome! Its amazing what some people will say to get someone to do their homework.
BC @ CV
19-Dec-12 15:59pm
View
Grazie signore.
BC @ CV
19-Dec-12 15:50pm
View
Thanks, that means a lot coming from you.
BC @ CV
19-Dec-12 14:30pm
View
Ok if you want to update a property in each item in your list just iterate like so....
int rank = 1;
foreach(Student s in students.OrderByDescending(x =>x.EnglishGrade))
s.PositionInEnglish = rank++;
BC @ CV
19-Dec-12 14:07pm
View
Are you then trying to sort by the combined GPA?
BC @ CV
7-Dec-12 12:27pm
View
Why are you making your Trans_No a varchar instead of an int?
BC @ CV
7-Dec-12 11:12am
View
Assembly reference is irrelevant. The above CSS will add the picture to the background of any Input element, which is the HTML element output by the ASP Button object. You could and probably should use a class name to reference it instead though. I will update the solution so its more clear what you should do.
BC @ CV
6-Dec-12 17:44pm
View
Are you looking to replace an id column of type uniqueidentifier with an id column of type integer? Or are you just talking about removing a column?
BC @ CV
6-Dec-12 15:49pm
View
Then I would assume that the work performed by the background worker has been completed. How else could it move on to this.Close() unless the progressBar1.Value is set 1000 and all previous commands are completed. Are any of the method calls in backgroundWorker1_DoWork() asyncronous? Do you wish the form to linger for a moment to make sure the user can see the progress bar is set to 1000? If so add another sleep command before this.Close().
BC @ CV
6-Dec-12 15:41pm
View
Even if you put it at the end of your code in backgroundWorker1_DoWork()?
BC @ CV
6-Dec-12 12:30pm
View
So if you are returning data from the ajax call what does parameter
id
contain?
BC @ CV
6-Dec-12 11:45am
View
Is it possible that
id.d.employee
is giving you the undefined error? Are you sure you're getting back the data you expect from the ajax call?
BC @ CV
6-Dec-12 11:29am
View
Since SQL Substring() returns a varchar, nvarchar, text, ntext, varbinary or image why are you comparing it to the
number
7? It would be easier to help you if you would state what you are trying to accomplish.
BC @ CV
6-Dec-12 10:18am
View
Perhaps you need a switch as in...
CALL "c:\rtdm_cutter.exe"
/f
20121126_191613_09224_RTDM.BIN "2012/11/25 15:00:00" "2012/11/25 15:15:00" y
I don't know if the name of the switch for this particular app is
/f
but you should. If you don't then perhaps your app has a help feature, which is usually accessible by passing
/h
or
?
as in....
CALL "c:\rtdm_cutter.exe"
/h
It sounds like you might benefit from studing DOS. Read
here
and
here
.
BC @ CV
5-Dec-12 16:01pm
View
Whether you add all common elements or not is a personal decision, but it wouldn't hurt to do so unless you might have other similar classes processed by this function in the future that wouldn't have those elements.
Often times interfaces are used to describe something a class should do, such as the .Net interface IEnumerable. You could change your interface to IRemovable and in that case it would seem highly appropriate to add only the methods and properties used by the RemUnwantedRows function to remove rows. You might even want to encapsulate the function itself into a base class that is inherited by the two classes.
BC @ CV
5-Dec-12 15:40pm
View
It sounds like you'd be better off using a ComboBox rather than a TextBox. What happens when someone enters 'A', 'Word', '1' or '#$%&*'?
BC @ CV
5-Dec-12 15:29pm
View
That's because you have no properties defined in your interface. It sounds like you could benefit from learning more about object oriented programming. Read
here
.
BC @ CV
5-Dec-12 14:23pm
View
since the two classes are your creation, that makes it easy. You just inherit the common interface (ref as Igos in my solution) and pass the class type you want the function to process as shown in my previous comment.
BC @ CV
5-Dec-12 13:47pm
View
I don't know what you mean by, "multiple ones for T". You just create classes that inherit the interface and pass the type thusly:
RemoveUnwantedRows<gosooeamount>(lstData)
If you are unable to inherit the interface because the classes are in an API you didn't create; you can either create your own derived class that inherits the gosooeamount and gosftepositions classes along with the interface or you can check which type the function is processing and cast it to that type. I suppose you could also use reflection but that's a lot of work.
BC @ CV
27-Nov-12 12:26pm
View
I assumed your problem was retrieving the file contents eg. "the tapes by titles or subjects." If you don't know how to create an HTML form to search with read
here
and
here
. After the web service returns the tape titles you will then need to use javascript to load it to the UI.
Show More