Sunday, June 30, 2013

MVC in Visual Studio 2013 Preview

Perhaps you should ask in a Visual Studio preview support forum rather than a totally unrelated forum?


Paul Linton


Why is ORDER BY allowed in TVF but not in INLINE TVF?

There must be a real simple explanation which escapes me right now. Thanks.


Does it mean I can trick the database engine? Use TVF with ORDER BY instead of ITVF?



CREATE FUNCTION Sales.ufn_SalesByStore (@storeid int)
RETURNS @Sales TABLE (ProdID int, Name varchar(50), Total money)
AS
BEGIN INSERT @Sales
SELECT P.ProductID, P.Name, SUM(SD.LineTotal) AS 'Total'
FROM Production.Product AS P
JOIN Sales.SalesOrderDetail AS SD ON SD.ProductID = P.ProductID
JOIN Sales.SalesOrderHeader AS SH ON SH.SalesOrderID = SD.SalesOrderID
JOIN Sales.Customer AS C ON SH.CustomerID = C.CustomerID
WHERE C.StoreID = @storeid
GROUP BY P.ProductID, P.Name
ORDER BY P.ProductID, P.Name;
RETURN ;
END
GO

CREATE FUNCTION Sales.ufn_SalesByStore1 (@storeid int)
RETURNS TABLE
AS
RETURN
(
SELECT P.ProductID, P.Name, SUM(SD.LineTotal) AS 'Total'
FROM Production.Product AS P
JOIN Sales.SalesOrderDetail AS SD ON SD.ProductID = P.ProductID
JOIN Sales.SalesOrderHeader AS SH ON SH.SalesOrderID = SD.SalesOrderID
JOIN Sales.Customer AS C ON SH.CustomerID = C.CustomerID
WHERE C.StoreID = @storeid
GROUP BY P.ProductID, P.Name
ORDER BY P.ProductID, P.Name;
);
GO
/*
Msg 1033, Level 15, State 1, Procedure ufn_SalesByStore1, Line 13
The ORDER BY clause is invalid in views, inline functions, derived tables,
subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified.
*/





Kalman Toth Database & OLAP Architect sqlusa.com

New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012







Why is ORDER BY allowed in TVF but not in INLINE TVF?

ORDER BY is always permitted when you insert into a table, alhough it does not mean anything unless the table has a target table has an IDENTITY column or a column with default of NEXT VALUE FOR (SQL 2012 only).


Thus, in the example you cannot trick anything. The Database Engine is free to completely ignore your ORDER BY clause.



Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se


Why is ORDER BY allowed in TVF but not in INLINE TVF?

Joe,


Trouble with VIEWs that they don't take parameters.


Consider INLINE TABLE-VALUED function as a view with parameters:



/******** INLINE table-valued user-defined function ***********/
CREATE FUNCTION ufnSalesByCountry (@CountryTerritory varchar(60))
RETURNS TABLE AS
RETURN
SELECT TOP 1000 [SalesPersonID]
,[FullName]
,[JobTitle]
,[SalesTerritory]
,[2006]
,[2007]
,[2008]
FROM [AdventureWorks2012].[Sales].[vSalesPersonSalesByFiscalYears]
WHERE SalesTerritory = @CountryTerritory;
GO

SELECT * FROM ufnSalesByCountry('Germany');
GO
/*
SalesPersonID FullName JobTitle SalesTerritory 2006 2007 2008
288 Rachel B Valdez Sales Representative Germany NULL NULL 1827066.7118
*/





Kalman Toth Database & OLAP Architect sqlusa.com

New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012


speech-to-text without a dictionary or grammar using c# ?

In windows 8.1 there is an text to speech api


http://code.msdn.microsoft.com/windowsapps/Speech-synthesis-sample-6e07b218



for windows 8 you would need to use something like this


http://translatorservice.codeplex.com/


Visual Studio throws an exception: "Object reference not set to an instance of an object."

This line asumes that mSpriteTexture has been set. This is propably not the case.



Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2





Well if I remove the line it starts perfectly (but I still think it's important) any suggestions?



I LOVE VISUAL STUDIO ULTIMATE 2012!!! (Since I was coding with the express versions, now when I have the brand new one it's great!


Visual Studio throws an exception: "Object reference not set to an instance of an object."

What do you mean "I think it is important". Either you need the line/Size or you need it not. There is no "maybe" in Programming.


From the code you showed us, the Reactangle Size has no meaning at all. It seems to store the precalculated Scaled Size of the texture, but it is never used. The Rendering Engine just takes the Texture and the Scale, not Size.


What makes it even less understandable, is that you have this line in two different places:


Once in Scale.Set()

Once in LoadContent()


The one in Scale.Set() could fail because there is no Texture loaded (yet).


The one in LoadContent() could fail when "theContentManager.Load<Texture2D>(theAssetName);" returns null.




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


Visual Studio throws an exception: "Object reference not set to an instance of an object."


What do you mean "I think it is important". Either you need the line/Size or you need it not. There is no "maybe" in Programming.


From the code you showed us, the Reactangle Size has no meaning at all. It seems to store the precalculated Scaled Size of the texture, but it is never used. The Rendering Engine just takes the Texture and the Scale, not Size.


What makes it even less understandable, is that you have this line in two different places:


Once in Scale.Set()

Once in LoadContent()


The one in Scale.Set() could fail because there is no Texture loaded (yet).


The one in LoadContent() could fail when "theContentManager.Load<Texture2D>(theAssetName);" returns null.




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2





Yeah I have noticed that this line is typed twice, however I solved it myself.



I LOVE VISUAL STUDIO ULTIMATE 2012!!! (Since I was coding with the express versions, now when I have the brand new one it's great!


How to get ASCII values for THAI Characters using T SQL ??

Hi Vini875,


To store Unicode string data, we can try nvarchar. For more detail information, please refer to the following link:


nchar and nvarchar (Transact-SQL)


http://msdn.microsoft.com/en-us/library/ms186939.aspx




Allen Li

TechNet Community Support



How to get ASCII values for THAI Characters using T SQL ??

Hi Allen,


Thanks for your relpy.


The columns whic have the above shown data are already nvarchar.


As stated above, my problem is, how can i identify these type of characters, as its mixed with Thai non of the options given on internet work for me !!!




Vinish Viswanathan


Managing printing over print server 2003 in C#

Hi All experts


I am developing a web based application in C#. I have get all printers installed over a print server (windows server 2003) and shown all printers in a grid view. Have also get print job queue for each printer in a separate grid view. Now I want some custom functionality here.


1. Initially each printer over printer server 2003 should be in ready state


2. Initially all print jobs should be in pause state


3. When the printing supervisor resume any print job shown in grid view, that specific job should go to printer for print.


I have implemented Print job resume and cancel function in c#, both functions are working fine, problem i have is, initially printer should in ready state and all print jobs should in pause status, so that only print supervisor can select a job and resume it.


Waiting for reply please


how to create master page in c# windows application.

The closest I can think of a Docking Systems/Dockpanel Systems (not to be mistake for the DockPanel Containers in WinForms and WPF). Something like Visual Studio allows. Except that you may or may not want to limit the area the undocked Windwos can move in to thier containers borders?


If so google for "WinForms Window docking system", there are several third party libraries avalible. WinForms and even WPF lack any native support for such features.




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


how to create master page in c# windows application.

you can use TabControl or use MdiParent property to archieve your goal. you can refer to the article to get more help:


http://www.codeproject.com/Articles/23593/Building-an-MVP-Framework-for-NET-Part-3-Designing




If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. My sample


OnLoginFailed AxMSTSCLib.AxMsRdpClient8NotSafeForScripting

That does not look like a Microsoft Control. I barely got 5 hit's on google.


Accordingly we cannot say anything about it, much less debug it.




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


OnLoginFailed AxMSTSCLib.AxMsRdpClient8NotSafeForScripting

That one is called MSTSCLib, without the Ax for ActiveX at the front (and I get better results with that search):


http://msdn.microsoft.com/en-us/library/aa383022%28VS.85%29.aspx


Sound like an ActiveX based API for the Remote Desktop Protokoll.


From what I read while looking there, it could be that the Connection atempt is not a Blocking call. So you perhaps expect the Event to be raised instantly after/during the atempt, when it actually needs some time.


Or maybe this Event is only for Network based problems during Logon, not for User Credentials based Problems during Logon.




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


OnLoginFailed AxMSTSCLib.AxMsRdpClient8NotSafeForScripting

When I add a control to toolbar in Visual studio, I get this AxMSTSCLib, it is Microsoft.



InvokeScript

How to get ASCII values for THAI Characters using T SQL ??

It works for me correctly with Windows 7 (USA) and SQL Server 2012:



DECLARE @thai nvarchar(max) = N'มหัพภาค';

SELECT @thai;
-- มหัพภาค

SELECT UNICODE (LEFT (@thai, 1));
-- 3617





Kalman Toth Database & OLAP Architect sqlusa.com

New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012


changing language for choice columns

Ok, I see. One last question, have you ever tried to use Visual Studio for content translations? Would it work? Greets, Diana.

why do we use using() when creating an object of IO stream?

Is it nessesary? No


It is highly recommended? Yes!


The Problem is that StreamWriter uses umanaged resources. Unamanged reousrces have to be freed. If you jsut stop referencing it, the GC will at some undertermined point in the Future (between now and end of appliaction) collect the Isntance and also free the Umanaged Resources. But "undertermined point in Future" is just too late. You need a way to explicitly give the unmanaged resources back.


Hence all Classes that use Unamanged Resources (should) also implement the iDisposable Interface. Calling iDisposable.Dispose() is a way to make certain that the unmanaged Resources are returned now. Dispose will also usually Close() the object, wich in turn includes Flush().


All using does is make certain Dispose() is called after the using block is left, even in case of an exception. It is identical to (and compiled as) try...finally block. And that is why the use of using is highly recommended, whenever you deal with unmanaged Resources (like Files and Network Connections).




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


why do we use using() when creating an object of IO stream?

thanks Christopher.......


farooq.hnf


Sharepoint 2013 and SQL Server 2012 Reporting services in integrated mode

While installing SQL Server Reporting Services 2012 SharPoint 2013, one requirement for SQL Server is 64-bit edition of Microsoft SQL Server 2012. For the detail information about it, please see:

Hardware and software requirements for SharePoint 2013


Besides, please ensure that the setting when you install Reporting Services are correct, you can refer to the link below to check it.

Install Reporting Services SharePoint Mode for SharePoint 2013


Sharepoint 2013 and SQL Server 2012 Reporting services in integrated mode

I have not found adding Sharepoint features on Dev Machine ....I think it is not possible to have SQL Server 2012 SSRS to install in sharepoint integrated mode.


Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/



MS SQL optimization: MS SQL Development and Optimization

MS SQL Blog: Large scale of database and data cleansing

Remote DBA Services: Improves MS SQL Database Performance


My XML document will not save changes made to the document

Hello all,


I am building an application that will allow my user to change their password. Their password will be stored in an XML Document. Also, I plan on doing password reset based off of secret questions, stored in an XML document. My code steps-through without error, but the XML document remains unchanged.


In my properties for the XML file, I have tried to set "Copy to output" as "Copy Always", and "Copy if Newer", no luck.


My code for saving is as below:



XmlDocument XMLdoc = new XmlDocument();
string XMLfilename = "PasswordHoldDoc.xml";
XMLdoc.Load(XMLfilename);
XmlNode root = XMLdoc.DocumentElement;
String pwdNode = root.FirstChild.InnerText;
//XmlNode pwdNode = XMLdoc.SelectSingleNode("/directory/password");
if (pwdNode != null)
{
root.FirstChild.InnerText = passwordConfirmTextbox.Text;

XMLdoc.Save("PasswordHoldDoc.xml");
MessageBox.Show("done!");



-JG


My XML document will not save changes made to the document

you remove the location in your codes. Like below:



XmlDocument XMLdoc = new XmlDocument();
string XMLfilename = "PasswordHoldDoc.xml";
XMLdoc.Load(XMLfilename);
XmlNode root = XMLdoc.DocumentElement;
String pwdNode = root.FirstChild.InnerText;
//XmlNode pwdNode = XMLdoc.SelectSingleNode("/directory/password");
if (pwdNode != null)
{
root.FirstChild.InnerText = passwordConfirmTextbox.Text;

// Only use Save method,
XMLdoc.Save();
MessageBox.Show("done!");





If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. My sample


Visual Studio throws an exception: "Object reference not set to an instance of an object."

The line is:



Size = new Rectangle(0, 0, (int)(mSpriteTexture.Width * Scale), (int)(mSpriteTexture.Height * Scale));





I LOVE VISUAL STUDIO ULTIMATE 2012!!! (Since I was coding with the express versions, now when I have the brand new one it's great!


Visual Studio throws an exception: "Object reference not set to an instance of an object."

This line asumes that mSpriteTexture has been set. This is propably not the case.



Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


speech-to-text without a dictionary or grammar using c# ?

can we convert a speech-to-text without pre written dictionary or grammar (using c#)?

Visual Studio throws an exception: "Object reference not set to an instance of an object."

I'm working in C# (actually XNA) and I have this code for my "Sprite.cs" class:



#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
#endregion

#region Sprite Logic
namespace XNAGame
{
class Sprite
{
//The current position of the Sprite
public Vector2 Position = new Vector2(0, 0);

//The texture object used when drawing the sprite
private Texture2D mSpriteTexture;

//The asset name for the Sprite's Texture
public string AssetName;

//The Size of the Sprite (with scale applied)
public Rectangle Size;

//The amount to increase/decrease the size of the original sprite. When
//modified throught he property, the Size of the sprite is recalculated
//with the new scale applied.
private float mScale = 1.0f;
public float Scale
{
get { return mScale; }
set
{
mScale = value;
//Recalculate the Size of the Sprite with the new scale
Size = new Rectangle(0, 0, (int)(mSpriteTexture.Width * Scale), (int)(mSpriteTexture.Height * Scale));
}
}

//Load the texture for the sprite using the Content Pipeline
public void LoadContent(ContentManager theContentManager, string theAssetName)
{
mSpriteTexture = theContentManager.Load<Texture2D>(theAssetName);
AssetName = theAssetName;
Size = new Rectangle(0, 0, (int)(mSpriteTexture.Width * Scale), (int)(mSpriteTexture.Height * Scale));
}

//Update the Sprite and change it's position based on the passed in speed, direction and elapsed time.
public void Update(GameTime theGameTime, Vector2 theSpeed, Vector2 theDirection)
{
Position += theDirection * theSpeed * (float)theGameTime.ElapsedGameTime.TotalSeconds;
}

//Draw the sprite to the screen
public void Draw(SpriteBatch theSpriteBatch)
{
theSpriteBatch.Draw(mSpriteTexture, Position,
new Rectangle(0, 0, mSpriteTexture.Width, mSpriteTexture.Height),
Color.White, 0.0f, Vector2.Zero, Scale, SpriteEffects.None, 0);
}

}
}
#endregion



When I start debugging I get this exception: "Object reference not set to an instance of an object."




I LOVE VISUAL STUDIO ULTIMATE 2012!!! (Since I was coding with the express versions, now when I have the brand new one it's great!


Visual Studio throws an exception: "Object reference not set to an instance of an object."

There are many places in your code which can throw the null reference exception. Which is the line that is causing the issue?


When an exception is thrown, Visual Studio will break at the problematic line. You can hover over objects involved in that line and see any one is null (first one from left). And then check why it is null.


I hope this helps.




Please mark this post as answer if it solved your problem. Happy Programming!


Visual Studio throws an exception: "Object reference not set to an instance of an object."

This is not an excedption from Visual Studio. This exception comeds straight from your Programm Code.


As it comes from your code, the Debuger should highlight/show you teh exact line where it happens. We need to know that line.


We also need to know the full Stacktrace of the Exception (should be in the same DialogBox as the exception itself).


Generally you get this exception when you try to access a Field/property/Function of an Object Reference that has not yet been created (there was no new or assigment targetting that Reference, or you set it to null since).




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


How do I fix this problem

Remove fname, or replace with Max(fname) or Min(fname)



select price=SUM(price),Max(fname) from stdsalary

Or

select price=SUM(price) from stdsalary


How do I fix this problem


create procedure ttt
@degree nvarchar(50)
as
select fname, SUM(price) as price from stdsalary
where degree=@degree
group by fname





Best Luck, Shenoy


How do I fix this problem


create procedure ttt
@degree nvarchar(50)
as
select SUM(price)Over(partition By fname) as price, fname from stdsalary
where degree=@degree


How do I fix this problem

The syntax is incorrect. If there are two qualifying rows, then which of the two fnames would you want to select?


If you know there is only ever going to be one unique fname for your selection, then you can simply add "GROUP BY fname" to your query.


if you want something else, then you first have to tell what you want before you can get proper advice on a solution.




Gert-Jan


Reading twitter stream with HTTPClient in Windows 8 App

There is a HttpCompletionOption on the SendRequestAsync() call -- set it to ResponseHeadersRead and the await will complete when the headers are read, not when the response completes.


http://msdn.microsoft.com/en-us/library/hh193601.aspx


.net c# close connection of shared folder

hi all


I'm creating a tool that will close some processes and close open files from shared directory.


the tool will run on the server and I want it to close the share connection automatically,


just like the "close all" button in the computer management.


how do i do that?


i'm using visual studio 2012 C#.


10x


Liran


MultiValues User Settings creation and use.

You might want to change your struct to a class that implements ApplicationSettingsBase. The way you are doing it is possibly scoping it as Application (which is read only) instead of User scoped.


http://msdn.microsoft.com/en-us/library/system.configuration.applicationsettingsbase.aspx




Bob - www.crowcoder.com


MultiValues User Settings creation and use.

Thanks Bob. That was a good article. I could create a class to store all values i need in one setting.


But how to use this class ? i can instansiate an object of this class and assign values to induvidual variables and then say save(). What happens when i click save(), do the variable created is stored in the system on a stack ?


After i do the save, how to iterate through all the differnet sets of values i saved ?


Also, are these values persistant across application restarts ?


Thanks in advance.




-Giri.


MultiValues User Settings creation and use.

I've never implemented ApplicationSettingsBase myself, I just knew of it. So built a test app to try it out. When you implement ApplicationSettingsBase, that is what your app will use for all of its Settings. So instead of using the designer to add Settings, you do it with code in the class you write.


I have put the project up on my sky drive, it is the CustomObjectSettings.zip file:


https://skydrive.live.com/redir?resid=E11159446BDBA3B3!2002&authkey=!AAib_vCsZ-bF5aA


If you don't have VS2012, then at least you should be able to open the files and read the code.


Files:


MyUserSettings.cs - This is the class that implements ApplicationSettingsBase. You will see three properties. One is a custom class I call "TheCustomObject". This just demonstrates how you can really use any class you want as a Settings property. Like the other two properties, it is decorated with [UserScopedSetting()] attribute. This is telling it that the user can modify the value. A user will only see their own changes, and it will persist between application invocations. It is also decorated with [SettingsSerializeAs(System.Configuration.SettingsSerializeAs.Xml)]. This is needed so that the custom objects properties can be persisted and read back by the application. There are two other properties, only included to demonstrate that you can add typical properties like strings and ints. They are also scoped by User and I also demonstrate how to give them default values. Lastly, in the construction I new up a TheCustomObject if it is null. The first time a user runs the app, this will be null and trying to get or set any of its properties will fail. Once Save has been called for the first time, the application will reload TheCustomObject from the serialized xml and it won't have to create a new one.


CustomObject.cs - this is the complex object definition that I'm storing in Settings. It just demonstrates that you can store any class you want as a settings property.


Form1.* - this is the form with labels and textboxes to identify and modify the application's settings. There is a Load method that reads values from the Settings and sets them into the textboxes, and there is a Save method that takes the values from the textboxes and updates the Settings. You can shut down the app, restart, and the last settings you saved will come back. You will see that I manually set and retrieve the settings but you could set databindings on the controls to save some work. I just think it is a better learning example to see it done manually.






Bob - www.crowcoder.com


MultiValues User Settings creation and use.

This is often asked. The best answer I can give is: Forget creating that UserSetting at runtime.


If you need one value of that type, just create it in the settings.


If you need a not precisely know amount of settings of this type, just add a single List<v_strct> to the UserSettings and modify the contents of that list.

If you insist on string indexing, use a Dictionary<String, v_strct>;


It is faster, no headache, and you can go over it with a for or foreach loop if you ever need to find a specific isntance.




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


MultiValues User Settings creation and use.

It apparently either requires a minor sublcassing trick, or manual changing of the File:


http://stackoverflow.com/questions/951876/can-you-have-a-generic-listof-t-in-your-settings-file


The C# version of the inheritance approach would be:



public class ListOfV_Structs : List<v_struct> {}

Add the type "ListOfV_Structs", just as any other type not in the ComboBox. You have to manually specify the fully qualified name, as you cannot brows your own project (for some reason). For example:



public class CollectionOfFilms : ObservableCollection<Film> { }

In Namespace WPFViewModelExample:


WPFViewModelExample.CollectionOfFilms


Can't really give you screenshots, my Visual Studio is stuck on German.




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


How to get ASCII values for THAI Characters using T SQL ??

The character you mention is not an ASCII symbol; it is not in the original 127 characters, nor is it in the extended table (see http://www.asciitable.com/).


So you need to use a unicode data type, such as nvarchar.


It is essential to use an nvarchar data type in which you import the data, because if you import into a "regular" varchar, the unicode information is lost.


After that, you can use the UNICODE() function on a symbol to determine its unicode value.


Alternatively, you can convert the nvarchar value to varchar and back and compare it to the original value. If it has changed, then the value contained at least one non-ASCII character.




Gert-Jan


Windows Store App - GridView

Hi,

Check the margin property in the GridViewItem if you're using GridViewItem or in the parent template control if you're using dataTemplate.



Regards,




Ibraheem Osama Mohamed | My Blog | @IbraheemOM | My Website



(If my reply answers your question, please propose it as an answer)


Multiple Inheritance in .net

Comments to your comments:Multiple Inheritance. You are propably the only person who would think Multiple Inheritance of Classes and Multiple Inheritance of Interfaces is remotely the same. Or that anyone would ever mean Multiple Inheritance of Interfaces in the first place, when speaking of Multiple Inheritance.


Look up on Wikipedia what a word means, before you roll on the floor:


http://en.wikipedia.org/wiki/Multiple_inheritance


Good idea, bad idea


And using pointers is also a good idea if properly used. Reality shows us that too many people used it wrong (see the patchlist of any generation of Windows). So it is generally a bad idea. Same applies to multiple inheritance (of classes).


The rest is pretty much jsut "desconstruction sentence by sentence - inlcuding repeating the same arguments". Wich is in my wolrdview a clear sign that you are not discussing anything, but only try to devalue the person you are talking too.




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


Remove XML Node

One way by using Linq:



string path = Path.Combine(Path.GetTempPath(), "Xml\\creditlimits.xml");

XElement root = XElement.Load(path);

root.Descendants("Limit")
.Where(x => x.Value == "925").Remove();

foreach (var item in root.Elements("Limit")) {
Console.WriteLine(item.Value);
}
root.Save(fileName);

wizend

changing language for choice columns

Hi,


I have an Sharepoint application in English and I want to make it available in German too. The problem is with the choice columns and with the text from Homepage (is in a web part) that keep the values/text only in one language. Is it any possibility to have these in English and German- when the language is switched?


Thank you in advance,


Diana.


changing language for choice columns

Are you using MUI or Variations for handling multiple language? are your choice columns custom or built-in?



THosE wHo doN'T apPreCiATe LiFe, DOn't DeSerVe iT


changing language for choice columns

Thank you for reply.


Yes, I'm using MUI. I have installed the German package language, I use English as primary language and German as secondary language.


I change the language to German by clicking in browser on the the context user menu ( up right corner) and selecting the displayed language in German.


The choice columns are custom, with choices that I defined. And I just can't make them to be shown in German when I switch the language from English to German.


changing language for choice columns

Hi Stefan,


Thank you for your reply. I used the taxonomy method, created a new metadata column and it works fine now :) I have all the choices translated.


Thank you for suggestion.


Do you know also how could I have the home page body text translated? (it's text with the description of the site that was input by me).


BR,


Diana.


Saturday, June 29, 2013

nvarchar(n) and nvarchar(max) different datatypes?


In a nutshell, it appears that you cannot use a NVARCHAR(MAX) in an index using SQL Server 2012 SP1



An add on on this, the same behaviour on SQL server 2008 R2. You cannot create an index on an NVARCHAR(MAX). BOL should be more clear about this.


Again, not that I would index an NVARCHAR(MAX)




Kind regards M


nvarchar(n) and nvarchar(max) different datatypes?

Hi bala,


it is not entirely true that index dependent columns can not be changed. The quote from BOL that I gave states as much. You can also test for yourself:


if col1 is nvarchar(500)


alter table MY_TBL alter column col1 nvarchar(2000)


will work fine.




Mordechai Danielov


nvarchar(n) and nvarchar(max) different datatypes?

Even the index on column with data type nvarchar(n) has limitation, because the limitation for Index Key size is 900bytes.


The below script successfully creates an index with a warning "Warning! The maximum key length is 900 bytes. The index 'ix_3' has maximum length of 8000 bytes. For some combination of large values, the insert/update operation will fail."



create table test_hunt1(c1 nvarchar(4000))

create index ix_3 on test_hunt1(c1)

If the index column is modifed with data more than 900 bytes, the operation fails.



insert into test_hunt1 select REPLICATE('a',400)--successful insert
go
insert into test_hunt1 select REPLICATE('b',500)--failure



The reason Nvarchar(max) is not applicable is , it is BLOB and its storage pattern differs.


Also, choosing large datatypes for index key, would increase the size of B-tree, be cautious.




Thanks

Sarat



Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.


nvarchar(n) and nvarchar(max) different datatypes?

Hi Dan,


you call it an "internal data type change". That's precisely what I'm asking. Where can I see this distinction? is it documented?




Mordechai Danielov


nvarchar(n) and nvarchar(max) different datatypes?

Absolutely, but correcting myself you can Include them in an index.




Kind regards M


nvarchar(n) and nvarchar(max) different datatypes?

The "max" keyword changes the data into a "Large Value Data Type".


Please see:


http://msdn.microsoft.com/en-us/library/ms178158(SQL.100).aspx


SQL Server

I have two tables in first table and second table having two common colums but i want to retrive the first table colums those are not matching to the second table values.


pls help me


Thanks in Advance


VS2012 Editor kerfuflle

Yes, I checked and it is checked.. Thought maybe since that just started having problems last night, it somehow got unchecked.. But, no, it is still checked.


Wenda


how to insert a image by clicking a button?



private void Button_Click_1(object sender, RoutedEventArgs e)
{
img1.Source = new BitmapImage(new Uri("C:/Users/Sudhir/Documents/VisualStudio2012/Projects/App6/App6/Assets", UriKind.Absolute));
}

this tho code i used but it is not displaying the image ?


img1 is name of the image box i used


Displaying drives in a listview problem.

Hey guys I want to display all the drives, drive letters and drive types in a listview but when I debug I see this



And I'm getting this warning>



This is the code I'm using



Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

ListView3.Items.Clear()
Dim b As Integer = 0
For Each drive In IO.DriveInfo.GetDrives
Dim itemText As String = drive.Name
Dim Type As String
Dim ltr As String = drive.Name
If drive.IsReady AndAlso drive.VolumeLabel <= "Then" Then
itemText = drive.VolumeLabel

Else
Select Case drive.DriveType
Case IO.DriveType.Fixed : itemText = "Local Disk"
Case IO.DriveType.CDRom : itemText = "CD-ROM"
Case IO.DriveType.Network : itemText = "Network Drive"
Case IO.DriveType.Removable : itemText = "Removable Disk"
Case IO.DriveType.Unknown : itemText = "Unknown"

End Select

End If

Select Case drive.DriveType
Case IO.DriveType.Fixed : Type = "Local Disk"
Case IO.DriveType.CDRom : Type = "CD-ROM"
Case IO.DriveType.Network : Type = "Network Drive"
Case IO.DriveType.Removable : Type = "Removable Disk"
Case IO.DriveType.Unknown : Type = "Unknown"

End Select
ListView3.Items.Add(itemText)
ListView3.Items(b).SubItems.Add(ltr)
ListView3.Items(b).SubItems.Add(Type)

b += 1
Next

End Sub


Private Sub ListView3_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView3.DoubleClick
Dim SelItem As String = ListView3.SelectedItems(0).SubItems(1).Text
For Each drive As IO.DriveInfo In IO.DriveInfo.GetDrives
Try
Process.Start(SelItem)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "ERROR")

End Try
Next
End Sub

Private Sub ListView3_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ListView3.KeyDown
If e.KeyCode = Keys.Enter Then
Dim SelItem As String = ListView3.SelectedItems(0).SubItems(1).Text
For Each drive As IO.DriveInfo In IO.DriveInfo.GetDrives
Try
Process.Start(SelItem)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "ERROR")

End Try
Next
End If
End Sub

End Class


I hope someone can help me out?

Thanks in advanced!


Displaying drives in a listview problem.

I agree with Acamar about the error message. I forgot to mention that i changed that line to



Dim Type As String = ""


ComboBox does not responds to mouse wheel rotation

Hi there!


I have noticed a weird combobox behaviour: combobox stops to respond to wheel rotation after text changing.


How to reproduce:




Dim array() As String = {"First", "Second", "Third", "Fourth", "Fifth"}
For i As Int32 = 0 To UBound(array)
combo.Items.Add(array(i))
Next
combo.AutoCompleteMode = AutoCompleteMode.SuggestAppend
combo.AutoCompleteSource = AutoCompleteSource.ListItems

Now run it and try to type in the combo's text field a letter, some items starts with, let it be 'F'. During typing suggestions dropdown list appears. Click on any suggestions item (let it be 'Fourth') - it will put item's text into text field. And try to rotate mouse wheel now: combobox have locked at 'Fourth' value and will not to switch to other items.


But combo could be switched by pressing down arrow and selecting items by mouse click.


What this means?



ComboBox does not responds to mouse wheel rotation

I had no problems with it. There was no lock. The mouse wheel worked fine. VS2012 Ultimate.



Public Class Form1

Dim Test() As String = {"First", "Second", "Third", "Fourth", "Fifth"}

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ComboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
ComboBox1.AutoCompleteSource = AutoCompleteSource.ListItems
For i As Int32 = 0 To UBound(Test)
ComboBox1.Items.Add(Test(i))
Next
End Sub

End Class





You've taught me everything I know but not everything you know. _________________________________________________________________________________________________________________ This search engine is for MSDN Library and has many features. http://social.msdn.microsoft.com/Search/en-US?query=search%20msdn%20library&beta=0&ac=8


ComboBox does not responds to mouse wheel rotation

Thanks for reply.


Maybe it indeed depends on studio version, not sure.


VS 2008 here. I won't to install fresh studio because I working on a project and switching to 2012 may cause a problem.


Has anyone with VS 2008 the same combobox problem?


C# 2.0 property or the underlying field for assignment?

Always use the properties. Especially in class code! In fact you should ignore the existence of the Private Varriable behind the property totally. You never know when something get's added to the Properties setter code (like change Notification) and at such a point not using the Property anywhere could be a gamebreaker.


Also as a sort of convention the private backing varriables should start with an underscore (private string _ParamName). That way you can prevent misunderstandings. More then one person ran into serious problems later on because he accidently accessed the backing varriable isntead of the property.




Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2


get server hardware information

This problem occurs because of a mismatch in the computer name and the name that the RPC service expects. The error is usually caused because the server can't be located. Make sure you can ping the server machine using the string you typed into the ComputerName property.


You can also try '.' as a substitute for the local computer name @"\\.\root\cimv2" .


wizend


VS2012 Editor kerfuflle

Check your settings:


Tools > Options > Environment > Find and Replace > Automatically populate Find What with text from the editor


should be checked.


Display textbox value and visibility according to selected value of combobox in Metro App

Hello Dewi,


It appears that "cbOperatingSystem.SelectionBoxItem" is of type "AdminPowershellExample.ServiceReference1.OperatingSystem". I guess you'll have to access it this way:



(cbOperatingSystem.SelectionBoxItem as OperatingSystem).operatingSystemType

This assumes that SelectionBoxItem is not null.

In any case, I recommend you debug you app and set a break point on the line that is failing and then inspect the actual value. That should be the fastest way to find out how you have to access the property you want.


Cheers.




Helge Mahrt - Microsoft Developer Support Escalation Engineer - If my reply answers your question, please mark this post as answered.





Display textbox value and visibility according to selected value of combobox in Metro App

Hi,


The code that you suggested works!


Do you mind explaining the code to me? I don't really understand it.


Thanks.



Display textbox value and visibility according to selected value of combobox in Metro App

Hello Dewi,


I'm glad to hear that it worked.


Well, you have not posted the code you use to populate the items in the ComboBox, so I did not know about the original structure you used. However, I saw that there had to be a "operatingSystemType" property due to the data binding:



<TextBlock Text="{Binding operatingSystemType}"/>

I also knew the object type due to the string that was saved in your database, "AdminPowershellExample.ServiceReference1.OperatingSystem", which was returned by the following code:



cbOperatingSystem.SelectionBoxItem.ToString();

If SelectionBoxItem had been a String you would have gotten the real string with this line. However, as SelectionBoxItem was an object of the type OperatingSystem, the ToString() function returned the type name, which is the value that was stored in the database.


With this information I knew how I had to cast SelectionBoxItem to be able to access the property operatingSystemType, as I suggested in my last post.


Hope this clears your doubts.




Helge Mahrt - Microsoft Developer Support Escalation Engineer - If my reply answers your question, please mark this post as answered.


Display textbox value and visibility according to selected value of combobox in Metro App

Hi Helge,


I get it now. Thanks for the elaborate explanation. It definitely clears any doubt that I have. Pardon me if I'm asking basic questions like these. I'm not really good at programming. Thus, I don't really understand the error sometimes even when I set a break point at a particular line.


I'll post again if I encounter any problems along the way for my project. I hope you don't mind me asking a lot of questions.


Thanks once again for the assistance. Really appreciate it!


strange issue: same t-sql query, same execution plan, same server, same wait type but different time

Exit from SSMS and try it again.


Kalman Toth Database & OLAP Architect sqlusa.com

New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012


Windows Store Apps - Images

Hi Kale,


See if the following code helps you:



Image image = new Image();
image.Source = new BitmapImage(new Uri(@"yourImageUrl"));
imageGrid.Children.Add(image);

Thanks.




Vicky Song [MSFT]

MSDN Community Support | Feedback to us

Develop and promote your apps in Windows Store

Please remember to mark the replies as answers if they help and unmark them if they provide no help.


How to use decimal(7,3) as Value field in a SSRS parameter?

Hi rune,


Instead of the selecting the parameter type as Integer, you need to set to float(Float can only handle numeric datatypes), Integer just truncate the part after decimal.


ParameterType




Regards Harsh


How to redirect page when i got any error in shaepoint site?

Hi,


In share point website when i got an error i want to redirect to some error.aspx page. is it possible??


Our traditional web applications when ever we got any error we are redirecting to one default error page. like that i want to implement in my site.


Please let me know how can i implement that page into my site.




Phani kumar


Query help

Hi Kapil,


Can you try this:



SELECT TempID,TransNo,MIN(VoucherNo) AS FirsvoucherNo,MAX(VoucherNo) AS LastVoucherNo,COUNT(TempID) AS Quantity
FROM
(
SELECT *
,CASE WHEN EXISTS (SELECT TOP 1 VoucherNo FROM T1 tmp2 where RIGHT(tmp2.VoucherNo,3) - 1 = RIGHT(tmp.VoucherNo,3) OR RIGHT(tmp2.VoucherNo,3) + 1 = RIGHT(tmp.VoucherNo,3))
THEN 1 ELSE 0 END AS TempID
FROM T1 tmp
) TEST
GROUP BY TempID,TransNo
ORDER BY TempID DESC





Regards Harsh


strange issue: same t-sql query, same execution plan, same server, same wait type but different time

First at all try with CTRL+L and let's see if youa have a lock and where...

iNdEpEnDeNt dUbAi ESCOrT +971528171730*-* dUbAi iNdiAn ESCOrT Agency

Dubai Royal /Escort? (+971528171730) in Dubai offering attractive and beautiful /Escort?. Our excellent Indian /Escort? Service in Dubai are aimed at high-class people who prefer level and style. Our escort agency has built an excellent reputation in Dubai and UAE on delivering what we promises. All of our Indian Escorts, models are fully committed to ensuring that the time you spend in their company will remain unforgetable in your life.



+971528171730



mail at the rate dubairoyalescort dot com



www dot dubairoyalescort dot com



Dubai Independent /Escort? (+971528171730) in Dubai, You're probably here for the same reason that we are: because you love beautiful women! As one of the most successful Dubai /Escort? agencies, we're passionate about bringing you gorgeous girls at low prices. We strive to give our customers everything that we would look for in an /Escort? agency; a friendly discreet service, excellent rates, a large selection of sexy girls with genuine photos and immediate bookings.



+971528171730



mail at the rate dubai-independent-escort dot com



www dot dubai-independent-escort dot com

iNdiAn ESCOrT Service in dUbAi +971528171730*-* iNdEpEnDeNt dUbAi ESCOrT

Dubai Royal /Escort? (+971528171730) in Dubai offering attractive and beautiful /Escort?. Our excellent Indian /Escort? Service in Dubai are aimed at high-class people who prefer level and style. Our escort agency has built an excellent reputation in Dubai and UAE on delivering what we promises. All of our Indian Escorts, models are fully committed to ensuring that the time you spend in their company will remain unforgetable in your life.



+971528171730



mail at the rate dubairoyalescort dot com



www dot dubairoyalescort dot com



Dubai Independent /Escort? (+971528171730) in Dubai, You're probably here for the same reason that we are: because you love beautiful women! As one of the most successful Dubai /Escort? agencies, we're passionate about bringing you gorgeous girls at low prices. We strive to give our customers everything that we would look for in an /Escort? agency; a friendly discreet service, excellent rates, a large selection of sexy girls with genuine photos and immediate bookings.



+971528171730



mail at the rate dubai-independent-escort dot com



www dot dubai-independent-escort dot com

strange issue: same t-sql query, same execution plan, same server, same wait type but different time

First at all try with CTRL+L and let's see if youa have a lock and where...

Query help

Or if you want work just with the number and if you have a costant V before the number you can use:



SELECT max(RIGHT(VoucherNo,3)) AS maxNU, min(RIGHT(VoucherNo,3)) AS minNU, TransNo FROM T1 group by TransNo





How to use decimal(7,3) as Value field in a SSRS parameter?

Hi rune,


Instead of the selecting the parameter type as Integer, you need to set to float(Float can only handle numeric datatypes), Integer just truncate the part after decimal.


ParameterType




Regards Harsh


Query help

Hi Kapil,


You will not get trans2 because you do not have a value "Trans2" for TransNo in the table T1.


I have tired this query which give exact result what you want by changing the last insert value from trans1 to trans2.



Create table T1
(Id int identity primary key,
VoucherNo varchar(10),
TransNo varchar(10)
)

Insert into T1 values ('V100','Trns1'),('V101','Trns1'),('V102','Trns1'),('V103','Trns1'),('V104','Trns1'),('V106','Trns2')

SELECT TransNo,
MIN(VoucherNo) AS FirsvoucherNo,
MAX(VoucherNo) AS LastVoucherNo,
COUNT(VoucherNo) AS Quantity
FROM T1
GROUP BY TransNo





Regards Harsh


Taxonomy Hidden List Powershell (SharePoint 2010)



I have a n issue where the taxonomy hidden list is not being updated even though I have run the "Taxonomy Update Scheduler" from central
admin. In any case I have powershell to attempt to get this list updated
but the powershell also has no results. Powershell below:
$site = Get-SPSite http://test-sample-site.co.uk
[Microsoft.SharePoint.Taxonomy.TaxonomySession]::SyncHiddenList($site)
$site.dispose()


Any assistance on this would be great.


Thanks


Taxonomy Hidden List Powershell (SharePoint 2010)

Hi monster597,


Do you mean that using the PowerShell script still doesn’t work to update the taxonomy list?


Try the code snippet below:


http://splog.cairo.ag/2012/09/20/updating-the-hidden-taxonomy-list-via-sharepoint-management-shell-2010/


Whether it make any differences?


Thanks,


Qiao Wei

TechNet Community Support



Breadcrump

Hi,

I have to implement breadcrump of the navigation within the site by a user. I have found the following code in the v4.master.



<SHAREPOINT:SPLINKBUTTON id=onetidProjectPropertyTitle navigateurl="~site/" runat="server"><SHAREPOINT:PROJECTPROPERTY runat="server" property="Title"></SHAREPOINT:PROJECTPROPERTY></SHAREPOINT:SPLINKBUTTON>

The above was replaced by the following code.



<ASP:SITEMAPPATH runat="server" hideinteriorrootnodes="true" rootnodestyle-cssclass="breadcrumbRootNode" currentnodestyle-cssclass="breadcrumbCurrentNode" nodestyle-cssclass="breadcrumbNode" rendercurrentnodeaslink="true" sitemapproviders="SPSiteMapProvider,SPXmlContentMapProvider">
</ASP:SITEMAPPATH>



This partially worked by showing the first link that user visits ,on left top of the site. But the problem is ,its replacing the site's logo.Also its showing only the first link.After that it doesnt show anything.

Any idea what changes do I have to make?


Breadcrump

Hi,


Thank you for your post.

I'm trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.


Thanks ,

Entan Ming




Entan Ming

TechNet Community Support



Update an Access Database From a DataGridView

the CellValidated event doesn't fire until you leave the cell.


you could call Update in your FormClosing event to catch any unsaved data when you close the form




thanks for any help


error when trying to connect to access database

What is the exact error message?


Do you have the right to your mdb file?


Has the Access file open in exclusive mode?


chanmm




chanmm

error when trying to connect to access database

Hi,


Any update on this issue?


Have you tried to hard code the data - connection?


Thanks.




Yoyo Jiang[MSFT]

MSDN Community Support | Feedback to us

error when trying to connect to access database

Thanx a lot.

error when trying to connect to access database

It's works for me thanks!

rows data in column

Hi,


Try this query:



IF OBJECT_ID('tempdb..#Test') is not null
drop table #test

create table #Test
( Code varchar(10),
CodeProperty varchar(100)
)

insert into #Test(Code,CodeProperty) Values
('GP1','Virus Protection'),
('GP1','Annual Desktop Support 1yr'),
('GP1','Online Data Backup'),
('GP1','TuneUp Utilities 2013'),
('PP3','Virus Protection'),
('PP3','Online Data Backup'),
('PP3','TuneUp Utilities 2013'),
('PP3','Annual Desktop Support 3yr'),
('AP1','Virus Protection'),
('AP1','Annual Desktop Support 1yr'),
('AP1','Online Data Backup'),
('A014','Annual Desktop Support 3yr'),
('PP1','Single incident'),
('GP3.1','Annual Desktop Support 3yr'),
('A027','Annual Desktop Support 3yr'),
('GP3','Annual Desktop Support 3yr'),
('A024','Online Data Backup'),
('A025','Annual Desktop Support 1yr'),
('A002','Annual Desktop Support 1yr'),
('A018','Virus Protection'),
('A011','Annual Desktop Support 2yr'),
('GP2','Virus Protection'),
('GP2','Online Data Backup'),
('GP2','TuneUp Utilities 2013'),
('GP2','Annual Desktop Support 2yr'),
('A010','Annual Desktop Support 1yr'),
('A016','Annual Desktop Support 2yr'),
('A013','Annual Desktop Support 3yr'),
('GP2.1','Annual Desktop Support 2yr'),
('A012','Annual Desktop Support 2yr'),
('A021','TuneUp Utilities 2013'),
('A026','Annual Desktop Support 2yr'),
('A017','Annual Desktop Support 3yr'),
('A015','Annual Desktop Support 1yr'),
('A1Y','Virus Protection'),
('A1Y','Annual Desktop Support 1yr'),
('A1Y','Online Data Backup'),
('A1Y','TuneUp Utilities 2013')

SELECT code ,
CASE WHEN [Annual Desktop Support 1yr] > 0 THEN 'Y' ELSE 'N' END AS [Annual Desktop Support 1yr]
,CASE WHEN [Annual Desktop Support 2yr] > 0 THEN 'Y' ELSE 'N' END AS [Annual Desktop Support 2yr]
,CASE WHEN [Annual Desktop Support 3yr] > 0 THEN 'Y' ELSE 'N' END AS [Annual Desktop Support 3yr]
,CASE WHEN [Online Data Backup] > 0 THEN 'Y' ELSE 'N' END AS [Online Data Backup]
,CASE WHEN [Single incident] > 0 THEN 'Y' ELSE 'N' END AS [Single incident]
,CASE WHEN [TuneUp Utilities 2013] > 0 THEN 'Y' ELSE 'N' END AS [TuneUp Utilities 2013]
,CASE WHEN [Virus Protection] > 0 THEN 'Y' ELSE 'N' END AS [Virus Protection]
from
(SELECT Code, CodeProperty FROM #test) AS SRC
PIVOT(
COUNT(CodeProperty)
FOR CodeProperty IN ([Annual Desktop Support 1yr]
,[Annual Desktop Support 2yr]
,[Annual Desktop Support 3yr]
,[Online Data Backup]
,[Single incident]
,[TuneUp Utilities 2013]
,[Virus Protection])
) AS pvt





Regards Harsh


SharePoint Designer 404 error

Hi,


I understand that you cannot open the site in SharePoint designer. How do you access the site? Using internal URL or external URL?


Make sure that you are accessing the site using internal URL. If this doesn’t fix this issue, you can repair SharePoint designer 2010 and Office 2010. Then restart the server to check whether it fixes this issue.


Thanks,


Entan Ming




Entan Ming

TechNet Community Support



intergrate Outlook 2007 Tasks and and Sharepoint 2010 Tasks.

Hi ddee,


To disable “Connect to Outlook” function in document library, I would suggest you to hide the ribbon button for the library.


To do this, you can create a SharePoint project using VS, and use CAML function to do this, here is an example:

Walkthrough: Removing a Button from the Server Ribbon:

http://msdn.microsoft.com/en-us/library/ff408060.aspx


Thanks,




Qiao Wei

TechNet Community Support



Limit the characters in a TextBox

Well, my question is very simple. Only one line code can do it.



TextBox.MaxLength = 10

But this only works when you are typing. Imagine the next case:



Dim s as string = "I.Need.Help.MSDN"
'16 characters'

TextBox.MaxLength = 10
TextBox.Text = s

'Final result in TextBox: I.Need.Help.MSDN that is higher than 10 characters'

So, what I want to do, is remove all characters up to my MaxLenght Value (10)


Is it possible?


(I´m using .Net Framework 3.5 in Visual Studio 2012)




Meu novo programa (Bloco de Notas) http://hyrokumata-app.blogspot.pt/2012/07/notepad-3-beta.html


Create a child node with a name? VB2010

Hello,


I have moved this thread to Visual Basic for better response.


Best regards,




Amanda Zhu [MSFT]

MSDN Community Support | Feedback to us

Develop and promote your apps in Windows Store

Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Continuing WP7/WCF problem

Friday, June 28, 2013

how to send email to several person in BCC section

You need to concat the bcc addresses in your first posted code like:


mail1.MailBcc += "your emailadresses " + ","


and then after the loop you need to remove the last comma like:



char[] stripComma = { ',' };
mail1.MailBcc = mail1.MailBcc.TrimEnd(stripComma);

As explaination: In the loop you are always assigning a new value to your MailBcc property replacing the old one. You can set multiple emailaddresses by separateing them with a comma.



Hannes



If you have got questions about this, just ask.



In a perfect world,

users would never enter data in the wrong form,

files they choose to open would always exist

and code would never have bugs.



My Forum Threads



C# Get Folder permisson by user name

issue with "Order by" clause

tempdb must be configured correctly for fast sort:


http://www.sqlusa.com/bestpractices/configureharddisk/


The difference from 1 sec to 5 mins does not make sense. How many rows in the output?




Kalman Toth Database & OLAP Architect sqlusa.com

New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012


C# Get Folder permisson by user name

How to get folder permission by specific username


DirectorySecurity


dSecurity = Directory .GetAccessControl( @"C:\Testfolder" );


foreach ( FileSystemAccessRule rule in dSecurity.GetAccessRules( true , true , typeof ( Testuser )))


{


Console .WriteLine( "Account:{0}\nRights:{1}" , rule.IdentityReference.Value,


rule.FileSystemRights.ToString());


}


Console .ReadLine();





Support@Mytechnet.me


Join Query


Try



SELECT t.name, tr.status
FROM Tasks t
LEFT JOIN
TaskRecords tr
ON t.taskid = tr.taskid
and taskDate = '2013/06/30'

Hi,


I tried this and works fine if no Task Record exists.


However, if a Task Record does exist, it returns that record, but also a number of NULL task records.


Cannot save report to server after adding a 2nd dataset

Hi.


I built a report using Report Builder 3.0 and I saved it to my server. The report works ok!


After adding a 2nd dataset (from the same datasource), it finds the fields and gives me no error, but when I try to save the report it gives me the following error:



Unexpected end of file has occurred. The following elements are not closed: Message, MoreInformation, detail, soap:Fault, soap:Body, soap:Envelope. Line 1, position 63684.
----------------------------
Response is not well-formed XML.
----------------------------
The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.



When I try to save it to my local computer, it saves it without problems.


Any suggestions?


Thank you!



Cannot save report to server after adding a 2nd dataset

Hi PedroPeixoto,


I am unable to reproduce the issue in my test environment. Have you added any parameters, added embedded images, or changed the report design structure after adding the dataset? Here, the following suggestions are for your reference:



  • Microsoft ASP.NET imposes a maximum size for items that are posted to the server. By default, this limit is 4 megabytes (MB). If you upload or publish a file that exceeds this limit to a report server, you receive an HTTP exception. Please make sure the report size is not larger than 4 MB.

  • If the report has too many columns, try to reduce the number of columns and check the issue again.


Regards,




Mike Yin

TechNet Community Support



Is it Possible to get distinct values from GetListItems?

Hi,


Thanks for your information.


I corrected the code in my mistake and Complete it.


Alternate Configuration of url in sharepoint 2010

Hi..


In SharePoint i developed webparts with default url and i configured alternate access for Intranet and i am getting error for "Go back to Site" in SharePoint sites to default url for even intranet access url..how to resolve it




Ravindranath


Alternate Configuration of url in sharepoint 2010

Hi Ravindranath,


You can also consider to modify it in MasterPage with something like this, to navigate to back page from browser history:



<asp:HyperLink NavigateUrl="javascript:history.go(-1)" Id="idSimpleGoBackToHome" Text="Go back" runat="server"/>

Please go through following link for further reference:


http://anton.djurasaj.me/2010/10/changing-go-back-link-in.html


http://social.msdn.microsoft.com/Forums/sharepoint/en-US/5af042b7-eab8-408f-b59b-4a38009f2771/how-to-modify-go-back-to-site-link




Please don't forget to 'mark answer/propose answer' or 'vote as helpful' as appropriate.



logged in as a different user does not display the viewlsts items



i am site admin yet i dont get to see the viewlsts items.


Actually the original admin gave me rights to access the site.


When i open the viewlsts, there is no items displayed. please help


logged in as a different user does not display the viewlsts items

Hello,


>viewlsts.aspx


This "view all site contents" are available for all users and you should see all list/libraries/pages/subsites if you have proper permission.


Are you able open any list/library/page in same site collection? Do you see anything if you click on any link in left side panel?




Hemendra: "Yesterday is just a memory,Tomorrow we may never see"


Whenever you see a reply and if you think is helpful, click "Alternate TextVote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Alternate TextMark As Answer


Please feel free to unmark answer if does not resolves your problem.


BeginReceive trouble...

I don't really understand what you wrote. But in my TCP listener, which is not Async, I set it to thread.sleep in order to allow the IP stack to release the logical port before I have it perform a Button Click to reinitialize the receiver. Which is an infinite loop of course.



Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
Dim ipAddress As IPAddress = ipAddress.Parse(TextBox1.Text)
Dim portNumber As Integer = TextBox2.Text
Dim tcpListener As New TcpListener(ipAddress, portNumber)
tcpListener.Start()
RichTextBox1.AppendText("Waiting for connection..." & vbCrLf)
Dim tcpClient As TcpClient = tcpListener.AcceptTcpClient()
RichTextBox1.AppendText("Connection accepted." & vbCrLf)

Dim FileSizeAndName As NetworkStream = tcpClient.GetStream()
Dim bytes(tcpClient.ReceiveBufferSize) As Byte
FileSizeAndName.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
Dim clientdata As String = Encoding.ASCII.GetString(bytes)

Dim Split() As String
Dim delimiterStr As String = "/"
Dim delimiter As Char() = delimiterStr.ToCharArray()
Split = clientdata.Split(delimiter, 3)

Dim File As NetworkStream = tcpClient.GetStream()
Dim FileLength(CInt(Split(0) - 1)) As Byte
File.Read(FileLength, 0, CInt(Split(0) - 1))
My.Computer.FileSystem.WriteAllBytes(TextBox3.Text & "\" & Split(1), FileLength, False)
Label6.Text = TextBox3.Text & "\" & Split(1)

Dim responseString As String = "Connected to server."
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(responseString)
File.Write(sendBytes, 0, sendBytes.Length)

RichTextBox1.AppendText(vbCrLf & "Message Sent /> : " & responseString)
tcpClient.Close()
tcpListener.Stop()
RichTextBox1.AppendText("exit")
Catch ex As Exception
RichTextBox1.AppendText(ex.Message)
End Try
System.Threading.Thread.Sleep(200)
Button1.PerformClick()
End Sub





You've taught me everything I know but not everything you know. _________________________________________________________________________________________________________________ This search engine is for MSDN Library and has many features. http://social.msdn.microsoft.com/Search/en-US?query=search%20msdn%20library&beta=0&ac=8



nvarchar(n) and nvarchar(max) different datatypes?

Hi Everyone,


I recently tried what I thought should have been a simple operation:


alter table MY_TBL alter column COL1 nvarchar(max) --currently nvarchar(500)


to my surprise it complained about indexes containing this column:


ALTER TABLE ALTER COLUMN COL1 failed because one or more objects access this column.


double checking BOL, it seemed like this shouldn't have occurred. Quote from BOL:


The modified column cannot be any one of the following:


...


Used in an index, unless the column is a varchar, nvarchar, or varbinary data type, the data type is not changed, the new size is equal to or larger than the old size, and the index is not the result of a PRIMARY KEY constraint.


a bit more digging, and I found some people saying that nvarchar(n) and nvarchar(max) were two different datatypes, however BOL makes no such claims:


http://msdn.microsoft.com/en-us/library/ms186939.aspx


can anyone point me in a right direction? Are they two different datatype? If so where is this documented, and if they are not why does the alter statement fail?


TIA,



Mordechai




Mordechai Danielov


nvarchar(n) and nvarchar(max) different datatypes?

Hi Mordechai,


Although I didn't find any documentation for it , but if you check it practically , then you will find bydefaul when you define any column as nvarchar(max) , its size would be set to -1 , which is less then the size of any nvarchra(value) columns length. Regarding difference in data type , so there is no difference in between nvarchar(value) and n varchar(max).


http://msdn.microsoft.com/en-us/library/ms186939.aspx


Here is a sample




W3C Compliance for SharePoint 2010 internet facing site

​Hi Folks,


I need to get W3C compliance for a SharePoint 2010 Intenet facing site.I want

to know that how i should approach for W3C Compliance.


Do i need to check W3C compliance for each page or with one of module or

finally with complete development of site ?


Which one would be better approach ?


Currnetly i am developing this as intranet site .Do i need to change my site

ip as public url to validated by W3C compliance ?


Thanks,


Keshav Roy




Keshav Roy


W3C Compliance for SharePoint 2010 internet facing site

Hi Keshav,


You may create a site and run it through the W3C Markup validation service to determine the errors: http://validator.w3.org/


You may follow the below practices to ensure that the pages are compliant. Please look into this:


http://www.trinkit.com/blog/2007/4/19/guide-to-making-sharepoint-xhtml-compliant


This link is just for your reference:


http://blog.drisgill.com/2009/11/sharepoint-2010-w3c-xhtml-compliance.html




Please don't forget to 'mark answer/propose answer' or 'vote as helpful' as appropriate.



One FBA Web Application with Multiple Membership Providers ?

Thanks, Paul. That's what I was afraid of :)

One FBA Web Application with Multiple Membership Providers ?

Dear Paul,


Currently we have requirement to configure different ldap membership on different zone of same Webapplication


Is it possible to multiple LDAP provider with different zone of Same web application?


Get Windows client user name for Asp.net

You need to execute server-side code to be able to get the username of the currently logged in Windows user. If you are using Windows authentication you can get the username by accessing User.Identity.Name.


To get rid of the popup asking for credentials for logged in users in IE, go to Tools -> Internet Options -> Security -> Custom Level -> "Automatic Login with current user name and password” -> OK -> OK -> Close and reopen browser.


Note that is a browser setting and you can't do much about it from the server-side.


SSRS report grouping issue

Hi


I have an issue in SSRS report design. I need help ASAP.


I have a report that have 2 DATASETS and 2 TABLES in the design I am displaying DATA in the first table and DATA related to the First table in the second table they both have totals in the fields.


First Table: This contains claims data and there will be a check amount and reason for the check amount and some details for those checks. I have to group this table by DEPT and USER and display the totals according to the grouping.


Second Table: This contains the check reasons and delay for that reason this should be grouped by DEPT and USER and should display totals according to the groups.


I tried adding groups for both of them it works fine but first the 1<sup>st</sup> table details are displayed at last 2<sup>nd</sup> table detils are displayed but I need in way that they should display according to their groups.




hemanth


SSRS report grouping issue

Hello,


It seems that the two datasets in your report share two fileds: "DEPT" and "USER", and you group the data in the two tables by the fileds above. If I understand correctly, you want to separate the details row in the two table based on the group instance.

For example, in the first page of the report, it display the "Claim data" for userA in first table and "check data" for userA in the second table; in the second page of the report, it dispalys detail data for UserB in the two table, and so on.


If so, you can move the two tables into a List control and group the list by "DEPT" and "USER": right-click the detail group of the List in Grouping pane, and then sepcify the filed you want to grouping by. You can specify page break for each instance of the group in List control.

Reference:http://technet.microsoft.com/en-us/library/dd239330(v=sql.100).aspx


Regards,

Fanny Liu




Fanny Liu

TechNet Community Support



Using a Scatter/Bubble Chart

Hi Scott,


From your description, I afraid this cannot be done in Scatter charts (Scatter chart, Bubble Chart) provided by Reporting Services.


However, if you use SQL Server 2012 Reporting Services working with SharePoint 2010 or 2013, this can be done in Power View report which is a feature of SQL Server 2012 Reporting Services Add-in for Microsoft SharePoint Server 2010 Enterprise Edition. It provides intuitive ad-hoc reporting for business users such as data analysts, business decision makers, and information workers. They can easily create and interact with views of data from data models based on PowerPivot workbooks published in a PowerPivot Gallery, or tabular models deployed to SQL Server 2012 Analysis Services (SSAS) instances. Power View is a browser-based Silverlight application launched from SharePoint Server 2010 that enables users to present and share insights with others in their organization through interactive presentations.


Reference:

http://msdn.microsoft.com/en-us/library/hh213579.aspx


Regards,




Mike Yin

TechNet Community Support



Need Help on Sharepoint and SSRS Integration

Hi,


We have a requirement to consolidate the data from two different sources (i.e, from SQL database and SharePoint list) and this consolidated report needs to be sent in an email.

We need to achieve this OOTB in SharePoint 2010.


We have tried the below approach:


Created SSRS report (i.e., RDL file) which will accept two parameters “From Date” and “To Date” to get the SQL data; so that, we can capture the data from report and save it in the SharePoint list. Once the data is available in SPList we can trigger an email using SP Designer workflow.


We tried to read the HTML content from report using JQuery, but we are unable to capture the report data. Report data is not available in page view source.


Please let us know if anyone has any alternate solutions or a work around for this requirement.


Thanks,

Prasanna