The one reason why Visual Studio SUCKS!!!!
We develop quite substantial applications for our clients, and we are using typed Datasets in the project I am on. Not the best option I know, but the option that was chosen.
Normally, I have only but praise for Visual Studio, but today I am extremely frustrated and wondering if it is really worth the money.
We are only half way through development on this application, we are actually busy with Change Requests from the client, but once we are finished with these we will be starting the next development phase. In that phase we will be adding in a massive section with brand new database tables etc etc etc. So our datasets are going to be growing by a large amount.
The issue that has caused my blood pressure to go through the roof today is this:
I opened up one of the datasets we use to delete two tables, and add them back in since the schema on the database counterparts had changed. when I deleted them, and then tried to save the delete. Visual Studio hung and when it came back about 10 minutes later, it kindly informed me that there was not enough memory to save the dataset, so I saved again and watched my memory usage while it was saving, it never hit 50%. So it is not a memory issue then. I tried a third time to save and this time it told me it can not save the Designer.cs file for the dataset, and asked me to select a location and file name for it. so I saved it as DataSet1.Designer.cs and it was happy.
I closed down visual studio, browsed to the location of the generated designer.cs and the one i saved opened them both up in notepad, and copied everything in my designer.cs to the generated one. Saved it and then opened up the Data Project in Visual Studio again. Deleted my designer.cs from the project and then rebuilt the solution. All fine and well.
So this prompted me to do some testing. I have two other Datasets in this solution, one that is very small, about 2 MB’s, and another that is of a similar size to the one I wanted to edit. So I went and did the same actions on both these datasets. on the small one, I had no issue, on the large one I got the same issue as I got earlier.
So after doing some more digging, I can only come to the conclusion that Visual Studio can’t handle Datasets that have a designer.cs file of more than 15 MB. To me this is ridiculous as there must be countless teams out there, using typed Datasets like us, who have datasets greater than 15MB.
To prove my point, we have an internal tool that generates Datasets for you. So I used the tool to generate it’s own files that it uses to generate Datasets, made my changes that I wanted to make, and then told the tool to generate my Dataset. this tool gave me no issue what so ever about saving the files, out of memory exceptions nothing, and it uses the cmd line tools that come with the Dot Net Framework.
So, if you ever think that you will have very large Datasets, you are better off spending your money else where. STAY AWAY FROM VISUAL STUDIO !!!!!
Multiple Office version support in Sharepoint Services 3.0
I had an issue in a sharepoint site where users could not open documents if they had Office 2003 installed but could open them if Office 2007 was installed.
So off i went trawling through the code, and eventually found a little bit of script that the previous developers had put in. They had done a massive developer no-no: The assumed the client would be running Office 2007, and therefore, had hardcoded the document click action to use the 2007 Office objects in Sharepoint.
When I checked with the client, and read through the design documentation, there was no mention at all about only using 2007. So my next step was to make it compatible with 2003 and 2007.
The issue here was that I could not just leave it up to sharepoint because they were not doing this properly, they just created a custom web part for these document lists.
So I eventually found a good resource on custom document editing management for Sharepoint Services.
Below is the code that was originally there:
<script type="text/javascript" language="javascript">
function ClientEdit(httpRoot, fileUrl, checkOut)
{
if (checkOut == undefined || checkOut == null || checkOut == true)
CheckoutviaXmlhttp(httpRoot, fileUrl);
var objEditor = new ActiveXObject('SharePoint.OpenDocuments.3');
objEditor.EditDocument3(window, fileUrl, false, 'Excel.Sheet');
alert('Selected document opened for edit. \nPush OK button after closing Excel.');
alert('Verify changes have been saved. \nIncorrectly formatted documents will \nbe automatically rejected.');
}
</script>
This is the code I finally settled on that worked within our sharepoint site:
<script type="text/javascript" language="javascript">
function ClientEdit(httpRoot, fileUrl, checkOut)
{
try
{
if (checkOut == undefined || checkOut == null || checkOut == true)
CheckoutviaXmlhttp(httpRoot, fileUrl);
var opened = false;
var objEditor = null;
objEditor=new ActiveXObject('SharePoint.OpenDocuments.2');
if(objEditor != null)
{
opened = objEditor.EditDocument2(window, fileUrl, 'Excel.Sheet');
}
else
{
objEditor=new ActiveXObject('SharePoint.OpenDocuments.3');
if(objEditor != null)
opened = objEditor.EditDocument3(window, fileUrl, false, 'Excel.Sheet');
}
if (opened == undefined || opened == null || opened == false)
{
alert('Could not open the document.\n Please make sure you have office installed.');
}
else
{
alert('Selected document opened for edit. \nPress OK button after closing Excel.');
alert('Verify changes have been saved. \nIncorrectly formatted documents will \nbe automatically rejected.');
}
}
catch(e)
{
alert(e);
}
}
</script>
I had to actually create an Office 2003 Sharepoint object, check if it was created. if so, then open the document, otherwise create an Office 2007 sharepoint object, check if was created and open. Otherwise, I had to tell the user that they do not have a supported version of Office installed on their machine.
This really felt like overkill for me, and I did some extra digging and found out that the most common thing to do would be to use shared workspaces to display document lists and allow for editing but I don’t know enough about sharepoint, I am just learning as I go along. So I have left it as a web part.
