Posts

Batch File for Windows to start/stop Oracle Services

In a bit of a departure from my regular coding I had to write a batch file yesterday that would start/stop our Oracle 11g instance on our server. Since this was old old old school stuff it took me some tweaking but i got it done. So now I've decided to share it with the rest of the world. Link to oracle.bat It's pretty simple you just call oracle.bat start/stop from the command line to start or stop your oracle services. Now the service names in there are specific to our instance so you will need to rename them to the values you have installed. Also this is for one database instance with one listener running. If you have different services running you just to need to add their service name to the appropriate start/stop section. It's a good base for extending if you need it.

Enabling Paging on a GridView

So I have been recently playing with GridViews in asp.net. Normally I use repeaters but the auto styles and paging have been appealing to me a bit lately. But there is some trickery to enable the paging on a GridView. You have to write a wee bit of code to get it to work correctly. The documentation doesn't make it abundantly clear on how to do this. What you need to do is implement the PageIndexChaning event and rebind your datasource to the grid. So for my project the code looks like this: protected void GridViewProducts_PageIndexChanging( object sender, GridViewPageEventArgs e ) { /* Reset your datasource, I am using a custom collection here */ this.GridViewProducts.DataSource = this.ProductsList; /* Set the new page index this comes from the GridViewPageEventArgs arguement passed into the method */ this.GridViewProducts.PageIndex = e.NewPageIndex; /* Rebind the grid */ this.GridViewProducts.DataBind(); }

windows powershell

So for those of you not in the know, microsoft has realesed a pretty good set of command line tools called windows powershell. It pretty much offers unix power commands to the windows command line. It's pretty cool and allows developers to add functionality via snappins. The microsoft documentation is here . A pretty good tutorial can be found here . I've followed the tutorial and found it fairly easy to create the cmdlet and snappin. Installation isn't as easy as I woule like but it's doable.

Internet Explorer 8 beta 1 is out

IE 8 from MS is now out in beta 1. I haven't had a chance to download and play with it yet but it's here. Download here!

JSP/Servlets vs ASP.NET

So if anyone reads this blog they know I write a lot of C# code. My work is currently looking at grabbing a new project using JSP/Servlets on Oracle rather then ASP.NET on SQL Server. I have no issue with the oracle, I hate SQL Server and think it's a kids toy compared to oracle. However I haven't written much java but from what I've read it seams pretty easy to write JSP/servlets. There seems to be a speed debate over the two so here are my two cents. ASP.NET I feel is not scalable. The project I'm working on takes 5000 users concurrently on a regular basis and it gets hammered on performance. We've looked and looked and the way microsoft suggests you do things works great for small projects with low users. But for enterprise level stuff asp.net has to be done in a radically different manner. So while you can get a web page up and running pronto it can't scale worth shit. We are currently struggling to implement these kinds of changes. Java on the ot...

Bad programmer, Bad!

Ok so I posted some javascript for a numeric only textbox and it wasn't working. Someone posted a comment about it so I took a look at it. Sure enough the whole thing was boned. Hopefully I didn't lead anyone astray or anything. So I fixed the script and tested it and found it works now. So if anyone wants to read the new script it's over here: JavaScript post

Saving Changes to a DataTable bound to a DataGridView

Ok, So I'm working on app that binds a datatable to a data grid view. Normally you would just edit right in the grid and be done. However our table has too much data to edit right in the grid so instead users have to click a row on the grid to load a details panel below the grid. This works great except I noticed changes made to the last row weren't being saved. This is because the grids don't commit changes to their datasource unless a new row is clicked. So after a few hours of digging I found this bit of code worked very well. // commit all our changes to the datasource of our grid if( dataGridViewVariables.BindingContext[_tableEditVariables] != null ) {   dataGridViewVariables.BindingContext[_tableEditVariables].EndCurrentEdit(); }//end if Check that the object in this case a data table being used to bind exists. And if it does call the end current edit on that object. However if you're binding to a custom collection of objects I believe you need to...