
bri189a
Avatar/Signature-
Posts
1014 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by bri189a
-
Should there be a seperate section or should we continue to post in the current threads. I think this might be confusing for new programmers as they may find an answer to a question that they think effects what they are doing (which is probably 1.1) and it really only effect 2.0...what does everyone else think?
-
You say <IMG src='<%# DataBinder.Eval(Container.DataItem, "ProductImage", "images/{0}") %>' border=0> doesn't work? Or were you setting something else's border?
-
So not having much C++ background or practical experiance I know very little on generics, pretty much just what I read at MSDN today; I love the concept and performance gains and seems easy enough to use, but here's the question for you experianced folks. I know it's a totally differant thing, but I use abstract factory pattern (I think is the correct pattern) to take a number of differant type of classes and expose a functionallity common to all of the through interfaces. Then I have a 'manager class' that will take any type of object that implements that interface and do work with it through the interface...(it took me a little while to figure out that interfaces are great for more than just gauranting a signature!) again I may have the wrong pattern listed, I'm just getting into design patterns (the correct naming of them) (btw, any good links on that would be cool). Anyway, I see a very strong resembelance to generics here, I don't have a feeling that this is the proper place for such a thing, and it seems generics should be used on more of a consumed object type than a object type that does management or manipulation, if you follow the differance I mean by that... I think there are some things about generics that haven't quite clicked yet and I'm looking for some good advice on the use and concepts of them. Thanks!
-
Public Function FixTags(HTML As String) As String Dim CorrectedHTML As String = HTML CorrectedHTML = CorrectedHTML.Replace("<", "<") CorrectedHTML = CorrectedHTML.Replace(">", ">") Return CorrectedHTML End Function Yes but this would be extremely slow compared to regular expressions; easier to read for someone who doesn't know regular expression though.
-
Step through the code with the debugger and see if the values are what you expect them to be, it may be that the id isn't there or something like that. HEADER may also be a key word, don't think so, but something to check. Try running the exact query in Access, (set it up under queries), then run it, Access will prompt you for the values, if it works there you at least know your SQL is good.
-
Your not using a stored procedure, your using inline SQL (text).
-
Managed DirectX Kickstart is a decent one... I'm cross language and prefer C# anyway so that worked good, but if you use the VB examples you should get through the book just fine, you'll probably pick up some C# syntax along the way which isn't a bad thing...the more language you know...the more places you can work (and the higher salary you can demand).
-
Thank you all for your reply's, keep them coming if you have them!
-
Or you never close the connection from your last call. Make sure you are calling dispose also!
-
[code=visualbasic] Private Sub PopulateBoxes() Try Dim strSelect As String Dim cmd As New SqlCommand Dim rdr As SqlDataReader DefineControls() cmd.Connection = SQLConn 'If you're worried about duplicate records use the distinct keyword 'or use a constraint on the database. strSelect = "SELECT DISTINCT id, fldClassName FROM tblClasses" cmd.CommandText = strSelect Try rdr = Command.ExecuteReader() Do While rdr.Read() 'I assume cboClass is a list box object 'IsDBNull() is VB6 legacy function - don't use. 'I assume id is an numeric type and fldClassName is a string 'or character type and that either field has the possibility of 'being null. If Not rdr.Item(0) = DBNull.Value AndAlso Not rdr.Item(1) Is DBNull.Value Then cboClass.Items.Add(new ListItem(rdr.Item(0), rdr.Item(1))) End If Loop Catch ex As Exception 'Do whatever you need to Finally SqlReader.Close() SqlReader.Dispose() 'can't remember if reader has dispose, think it does. End Try Catch MessageBox.Show(Err.Description) End Try End Sub 'And When The Index Changes On The Combo Box, Change The Text 'To Say What Valuemember Is Selected Private Sub cboClass_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboClass.SelectedIndexChanged Me.Text = cboClass.SelectedValue() End Sub [/code] Thanks In Advance -=Simcoder=-
-
You could just write out to csv and if clients computer has excel add ins then the csv will open excel. There is also the slk file format if you want the pretty colors and functions, but it's a pain.
-
I know I'm going to start a flame war unitentially but I'm looking for some info that I can't seem to filter out from the junk on Google. What are some major products that are written in .NET or prior 'Micorosoft' languages (I know C++ isn't a Microsoft language, but MFC is). I know Symantec is a Microsoft Gold Partner so I imagine anti-virus was written in C++ but if someone knew, and had white paper to prove it was written C++ (MFC) or even better C++.NET or event better C#.NET that would be awesome...basically I'm looking for any major product that anyone will probably of heard of that was written in a Microsoft language, preferably .NET but not necessarly. I'm also looking for major corporations that use Microsoft servers, or dropped UNIX servers for Microsoft... and why they did... I thought that kind of thing would of been easy to find on Microsoft, but couldn't find anything worded the way I need it. Basically I believe every OS out there has it's place, but what I can't stand is people who hate Microsoft for no other reason than they had a bad experiance with it and want to fit a square peg in a round hole because of it, so I need some fire power. I'm a huge Microsoft advicate, but I won't condemn Unix just because it's not Microsoft.
-
Problem With Sql Primary Auto Increment.
bri189a replied to Simcoder's topic in Database / XML / Reporting
That is just the nature of auto increment, if you want something to work as your are suggesting you will have to do the numbering yourself and that can be quite hairy. Bascially your column that keeps track when inserting a record will have to count how many records are currently there, then your delete will have to renumber all the rows above the row that is deleted so the numbers stay sequential. More than likely there is a differant way that you can accomplish what you are trying to do. If you present your problem you might get some good alternatives...in particular how are you using this number in the application that it is important that they be sequential? For instance, if you are just listing all the items and want them numbered you could use a ListView (in detail display type) and the first column can be a read only column whose value = it's item index + 1, and everything will be numbered correctly. There are several options out there along those lines. -
How to write clean sql code for .net??
bri189a replied to Goalie35's topic in Database / XML / Reporting
I just read Robby's post (wrote while I was writting mine I guess), BuisnessLayer = ApplicationLayer in my post - truthfully BuisnessLayer is better terminology...I'm just use to our inter-office terminology, and while his DAL doesn't include tables, SQL, or connection strings, ours do...that's a coding style differance, I've used his terminology at times...it just shows a differance in the way our shops operate, the important thing for you to notice is that we both say to keep the data out of the presentation layer and keep it as a seperate entity. :) -
How to write clean sql code for .net??
bri189a replied to Goalie35's topic in Database / XML / Reporting
Professionally speaking: You shouldn't put sql code within a page/form for a number of reason (security, change management, efficiency, reusability), and generally you want your data access to be it's own seperate layer. Keeping your data access layer seperate from your application and presentation layer is the generally accepted (and expected) method of a large scale professional product; however there is no 'rule' saying you have to do it that way. Keeping it seperate from application layer allows another application to use the same dll - this other application doesn't have to re-invent the wheel. Keeping the presentation layer seperate from the application layer means that an a web site, and a window application can run exactly the same because they have their own presentation layer, but have the same dll for the application itself, and that application layer uses the same data layer. Also if the data structure changes the data dll can be recompiled and distributed as an update rather than have to re-build the whole application. A lot of smaller projects, such as the one's I do for side cash have the application and presentation layer combined (because I know a certain thing will always be a web site - or at least the customer isn't paying enough or doesn't have the desire to make it portable to a windows application), but rarely, even on my smallest of small projects will I put the data access layer with application or the application/presentation layer... for some people that may be over kill but I have my reasoning. You always need to plan from the beginning for growth, expansion, and change...remember you want things to be loosely coupled and highly cohesive...putting everything together in one place makes things tightly coupled and have low cohesiveness... meaning what will take me 10 minutes to change (or fix) and simply update the dll through a small download will require someone who didn't design right from the beginning days or weeks to make the same change and have to redeploy the entire application. You might want to do some reading on the rational unified process, it changed the way I did my programming (for the better) a hundred fold. -
Dataview filter for null values in a date column
bri189a replied to donnacha's topic in Database / XML / Reporting
That expression in the help file is saying in plain english to take all null columns and set there value to the string 'Null Column' and then return any rows where Col1 equals the string 'Null Column'. .NET cannot take a DateTime field and set it to a string value on it's own (there is no implicit cast) and thus the reason for the error. It is in truth a bad example in the help file and should read: To return only those columns with null values, use the following expression: "Col1 IS NULL" I hope that clears things up for you. -
Dataview filter for null values in a date column
bri189a replied to donnacha's topic in Database / XML / Reporting
IsNull() is a function that replaces a null value with a specified value. In other words if there where any null values in the column "UserName" the following would update those values to "No User Name" for the return of the select statement (it doesn't update the dataset itself): "SELECT ISNULL(UserName, 'No User Name'), JoinDate FROM Members" 'IS NULL' is a comparission operator for null values, which you want to use. -
You probably also have a lot of instances of EXCEL.EXE in your task manager too since you have a message box that is open and waiting... office components don't dispose as easily as you would think...at least prior to 2003 or is it XP PD? You need to make sure your cleaning up your instances of Excel, server admins tend to get pretty upset when you crash a server because there are a few thousands instances of excel running.
-
There was nothing specifically that said it was better or putting it forward, just nothing saying there was something wrong with it. What spurred this whole things was an article in asp.net PRO magazine (this months cover story) which tells readers, as a work around when inheriting a 'base' page to get around the designer hic-cups to use #include files... as I said I generally consider using include file in ASP.NET a bad idea, and preach it mind you, and here is a magazine article that is advicating using them just to get around a fricken designer issue... http://72.14.207.104/search?q=cache:jd_nfZ_t6QMJ:www.informit.com/articles/article.asp%3Fp%3D173411+asp.net+%22include+directive%22+performance&hl=en http://72.14.207.104/search?q=cache:IHsObu9_rOwJ:authors.aspalliance.com/anjum/ASPMigration.aspx+asp.net+%22include+directive%22+performance&hl=en
-
I've always heard that using the include directive outside of classic ASP is a bad idea, I have coded believing that statement, however in a recent arguement, I mean discussion, I had to admit defeat because I couldn't find any supporting documentation for why it's a bad idea. I found a couple places where microsoft said 'generally you should use user controls...' but nothing concrete and specific, and more disappointingly I found some articles that said there is no performance differance, and even one that said it increases performance to use an #include directive. If this is the case then why are so many of us creating inherited pages for templates rather than using includes, or so many other things we do with user/server controls that we could use includes for? Blind ignorance? I personally like OO programming rather than typing html include files at the top of every page, changes are very easy...change the base class!, but not everyone works that deeply. I know a few of you out there, if there is documentation, you have it... and I really hope today you have it.... thanks!
-
Let me know when that's done please...
-
I use serverintellect.com - good prices, more importantly, good, not exported overseas, american service. Great for start-ups with the cheaper plans...they also do discounts for paying a year at a time.
-
how to shutdown computer using vb.net
bri189a replied to kanak's topic in Interoperation / Office Integration
Yes, it's on by default in 2000 and XP, it wasn't present until 98 SE if I know the history right. NT 4 it was there, but many components of it were missing. Some places that I have worked have it turned off because of security reasons, but that's way beyond any at home users, you shouldn't need to worry really. -
the only ip string I can think that you're talking about is session state...shouldn't need to touch that unless the server doesn't have sessions enabled in which case find a differant web host. As to the other part it depends on how your 'control panel' is set up, many place have a 'virtual directory' setting, but basically what it maps to is the ability for a program to run in that directory, your hosts help file should have something on it and you should be able to find out real quick if you copy the files over, go to the index page and nothing happens. If you get to talk to people directly, basically in there IIS configuration that folder would have an application associated with it and the execute permissions set to run scripts or higher. Hope that helps. Thanks for the link, but... Again, IBM's web site assumes you have experiance on the 400 or with RPG/COBOL/etc... I'm a .NET programmer, if I need to assign a variable I: string s = "Hello"; not Eval s = "Hello" or whatever it is, not to mention I don't have to worry about what character position I put it at...(and I know PDM takes care of that, but it's still a pain to read!!!!) also there is all this lingo that you either know or don't know... I need a forum like this for the 400, a site like asp101.com for RPG... that's what I'm looking for.
-
how to shutdown computer using vb.net
bri189a replied to kanak's topic in Interoperation / Office Integration
This assumes WMI is turned on for that. Use the API if you want the function to still work on computer like mine where I have WMI turned off.