Tuesday, December 31, 2013

How to sort items of a list by name within his index?

I've order my items by name in a list but i have a problem selecting using the SelectedIndex the item is not the same as selected



for (int i = 0; i < storageList.GetFileNames().Length; i++)
{

filesbyname.Add(storageList.GetFileNames()[i]);
}
var byName = from name in filesbyname orderby name.ToString().ToLower() select name;
_LirycListBox.ItemsSource = byName;

private void _LirycListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (_LirycListBox.SelectedItem != null)
{
NavigationService.Navigate(new Uri(string.Format("/EditorSongLiryc.xaml?filename={0}", storageList.GetFileNames()[_LirycListBox.SelectedIndex]), UriKind.Relative));
}
}


How to sort items of a list by name within his index?


From : _LirycListBox.SelectedIndex
To : _LirycListBox.SelectedItem





jdweng


How to display Employee Attendance Data in Crosstab Format?

You can use a query like below



SELECT EmpID,
InDate,
MAX(CASE WHEN EntryType = 'In' THEN InTime END) AS InTime,
MAX(CASE WHEN EntryType = 'Out' THEN OutTime END) AS OutTime,
CAST(DATEDIFF(minute,MAX(CASE WHEN EntryType = 'In' THEN InTime END),MAX(CASE WHEN EntryType = 'Out' THEN OutTime END))/60 AS varchar(5)) + ':' + CAST(DATEDIFF(minute,MAX(CASE WHEN EntryType = 'In' THEN InTime END),MAX(CASE WHEN EntryType = 'Out' THEN OutTime END))%60 AS varchar(2)) AS TimeDIff
FROM table
GROUP BY EMpID,InDate







Then in reporting service use a matrix container


Add EmpID to row group and InDate to Column Group. Add other fields to detail portion to get report in your format.


see attached rdl for details


matrix report




Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs



How to display Employee Attendance Data in Crosstab Format?

Following page has an example for dynamic crosstab:


http://www.sqlusa.com/bestpractices2005/dynamicpivot/


You can also build an SSRS report with dynamic columns.




Kalman Toth Database & OLAP Architect IPAD SELECT Query Video Tutorial 3.5 Hours

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



Cannot open database

Cannot open database


hi,


I am getting this error message while running my problem.How can i get rid of it.



Error Message:Cannot open database "employeedata" requested by the login. The login failed.




amature.



Are you getting this error from application you are trying to connect ? .Can you try this login from SSMS check if it succeeds if not please post the error message you got.


What is your frond end application.What connection string you are using ?


Just check if below link is helpful


http://www.sqlservercentral.com/Forums/Topic1423758-391-1.aspx?Update=1




Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers


Hyperlink text to open in a browser question

I'm super new to programming for Windows, and I am having a crazy time trying to create simple hyperlinked text or buttons that will open a browser (whether internally or externally).


I have journeyed across the internet trying to figure it out, but just can't quite it figured out.


Here is an example of what I am working with:



<Paragraph>
<Hyperlink NavigateUri="http://vcc.mst.edu/Content_Repository/soc/summary/xdis/spring/">
<Run Text="Access Course"/>
</Hyperlink>
</Paragraph>

But for some reason unknown to me (a newb), it appears to be a link... it clicks like a link, but won't take any action when clicked upon. And after being clicked on multiple times, the app crashes.


Suggestions.


Sorry, this is probably really obvious.


Hyperlink text to open in a browser question

Your example code is correct and works fine for me when I add it to a RichTextBlock. Clicking on "Access Course" opens IE and navigates to the class schedule.


Do you have something else on the page that may be capturing the PointerPressed?


Can you reproduce this in a minimal sample that you can share on your SkyDrive?


--Rob


Implementing RSS feed in a live tile.

I am developing a windows store 8 app which reads RSS Feeds and display it.


I want to activate the Live tile (TileWideText04) feature which displays the latest live feed continuously(and not once).


Please tell the steps and not give the link to the App Tiles and badges sample.


Thank You!


Number of rows set per page in SSRS2008

Number of rows set per page in SSRS2008

Number of rows set per page in SSRS2008

It depends on the report layout.


Ione


Number of rows set per page in SSRS2008

Hello,


If I understand correctly, you want add page break in the report based on the row number. In SSRS 2008, we can use group page break to work around the issue.


Please refer to the following steps:



  1. Add a table in report body, add several fields in the report.

  2. Right click “(Details)” in the Row Groups dialog box, select Add Group -> Parent Group (Group1) with following expression:

    =Ceiling(RowNumber(Nothing)/5)

  3. Right click Group1 in the Row Groups, select Group Properties.

  4. Click Page Breaks in the left pane. Select “Between each instance of a group” option.

  5. Click Sorting, then delete the sort which is based on Group1.


If you have any questions, please feel free to ask.


Regards,

Alisa Tang




Alisa Tang

TechNet Community Support



Sharepoint 2010 - Multiple line of text column with Plain text type

Try press ctr F5 and refresh the page to load it properly, also check in browser compatibility mode




Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL

INSQLSERVER.COM Mohammad Nizamuddin

Sharepoint 2010 - Multiple line of text column with Plain text type

It is SP2010 site and control is used in listform. I think SP2010 sites, browser compatibility is not required. I am still having the issue

SPGridView Filtering

Hi,


According to your post, my understanding is that you want to use the filtering feature of SPGridView in SharePoint 2010.


Here is an example for your reference, it is about how to use SPGridView in SharePoint 2010 Visual Web Part with sorting, filtering and paging functionality.


http://sanjivblog.wordpress.com/2013/09/20/creation-of-spgridview-webpart-with-sorting-filtering-and-pagination-ootb/


More information:

http://sharepointcodebox.blogspot.in/2013/03/sharepoint-gridview-filtering-sorting.html

http://code.msdn.microsoft.com/office/Ejemplos-sobre-cmo-usar-el-69cd5f16


Best Regards




Dennis Guo

TechNet Community Support



Sharepoint 2010 View Totals problems

are you expecting that the COUNT will only accumulate when the row has data in that specific column?


Generally speaking, COUNT is the total number of rows, and should be the same regardless of the column being shown in.




Scott Brickey

MCTS, MCPD, MCITP

www.sbrickey.com


Sharepoint 2010 View Totals problems

Hi,


According to your description, my understanding is that the Count for a column showed different number for different users.


Per my test, the Count will show the number of the items which containing data in the view that the user can see.


I recommend to verify the things below:



  1. Did this issue occur on all the other users? Please provide more information of the permission the users have.

  2. Did this issue occur with other lists? For test, I recommend to test the same scenario in a new list.


Best regards.


Thanks




Victoria Xia

TechNet Community Support



how to update data on c# console application. alredy i have retrive data


using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace project
{
class data
{
static void getdata()
{

SqlConnection con = new SqlConnection("Data Source=SANKALPA-PC;Initial Catalog=libray;Integrated Security=True");
con.Open();
DataSet ds = new DataSet();
try
{
string sql = "select * from book1";
SqlCommand cmd = new SqlCommand(sql, con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
printrow(Convert.ToString(dr["bookid"]), Convert.ToString(dr["title"]), Convert.ToString(dr["author"]), Convert.ToString(dr["publisher"]), Convert.ToString(dr["price"]));

}

con.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);

}
}


static void printline()
{
Console.WriteLine(new string('-', 80));
}
static void printrow(string bookid, string title, string author, string publisher, string price)
{
Console.WriteLine(string.Format("|{0}|{1}|{2}|{3}|{4}|",AlignCenter(bookid,17),AlignCenter(title,17),AlignCenter(author,17),AlignCenter(publisher,17),AlignCenter(price,17)));
}
static string AlignCenter(string text, int width)
{

if (string.IsNullOrEmpty(text))
{
return new string(' ', width);

}

else
{

//return text.PadRight(width - (width – text.Length) / 2).PadLeft(width);
return text.PadRight(width - (width - text.Length) / 2).PadLeft(width);

}

}



static void Main(string [] args)
{
printline();
printrow("bookid","title","author","publisher","price");
printline();
getdata();
Console.ReadKey();
}


}
}




Decreasing Side Margins

I have read the side margins cannot be changed to a specific value however maybe there is a work around that I have not thought of...


I want to reduce the initial space from 0 to the first bar in the chart (and for the last bar). Note that the category will be strings and not 1,2,3 etc...



Decreasing Side Margins

Hi St33ln,

Based on my research and test, customizing the width of the side margin is not a build-in feature. While we can enable or disable the side margins on the X-Axis of the chart. Please follow the steps:


1. Right-click the chart X-Axis, choose Horizontal Axis Properties.

2. Check the “Disabled” option below Side margins which is located in Axis range and interval.

Please see the result screenshot for your reference:



Therefore, I would suggest you submitting a wish at https://connect.microsoft.com/sql. Connect site is a connection point between you and Microsoft, and ultimately the larger community. Your feedback enables Microsoft to make software and services the best that they can be, and you can learn about and contribute to exciting projects.


Regards,

Heidi Duan



If you have any feedback on our support, please click here .




Heidi Duan

TechNet Community Support



Features are not available to all sites

check this guy


http://social.msdn.microsoft.com/Forums/sharepoint/en-US/96f1f87d-d442-4484-af5c-aedc2cb0c3c2/site-scoped-features-not-available?forum=sharepointgeneralprevious


http://social.msdn.microsoft.com/Forums/sharepoint/en-US/e53133a3-2fb0-4ffc-8f20-4d906a037b81/feature-deployment-scope?forum=sharepointdevelopmentlegacy


i would also check the feature.xml...http://msdn.microsoft.com/en-us/library/ms436075.aspx


could you please share the info how you adding the content type in db?




Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog


Columns and content types are not available to multiple sites

Hi Rego,


I think it is because of site scope, and what is the scope of you site columns, is that site scoped or site collection scoped.


Ensure all your content types and site columns are site collection scope and try again.


Check this link out for more information about scope -


http://msdn.microsoft.com/en-us/library/office/ms441146(v=office.14).aspx


Hope this helps






MCITP: SharePoint 2010 Administrator

MCTS - MOSS 2007 Configuring, .NET 2.0

| SharePoint Architect | Evangelist |

http://www.sharepointdeveloper.in/

http://ramakrishnaraja.blogspot.com/



Database is up to date but some sites are not be completely upgraded

I am getting "Upgrade Available" on all servers in the farm. On closer inspection, the above message is coming up in the "Review Database Status" area. I have run the Upgrade-SPContentDatabase command on the database but although it says it complete, the error above is still there. No error messages in log or warnings or anything.


Is there anything else I need to do?


Database is up to date but some sites are not be completely upgraded

Hi,


try running stsadm -o localupgradestatus. The output will probably tell you what item/site/object exactly needs upgrading.




Dirk Van den Berghe


Cannot open database

hi,


I am getting this error message while running my problem.How can i get rid of it.



Error Message:Cannot open database "employeedata" requested by the login. The login failed.




amature.


Cannot open database

Dynamic image displaying in WinRT

Hi,


Use these codes below:



private async void Button_Click_1(object sender, RoutedEventArgs e)
{
BitmapImage bitmap = await GetImage();
image.Source = bitmap;
}

See Asynchronous programming in winrt



We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


Cannot open database

hi,


I am getting this error message while running my problem.How can i get rid of it.



Error Message:Cannot open database "employeedata" requested by the login. The login failed.




amature.


can i implement a website ?

i want to implement a complete website as an windows store app in c# & xaml , is it possible ??, if so can any one provide me the samples to download or guidance ?

can i implement a website ?

No. Windows Store apps run on the local machine. They are not web sites.


--Rob


can i implement a website ?

then how apps like Flixstar , Box & stumbleupon are made , as all of them are websites prior to apps in store.

can i implement a website ?

yes i want to model my windows store app off a website, can you tell me how??

can i implement a website ?

This question is extremely vague and broad.


Maybe start by downloading some samples here:


Windows 8.1 Samples


And then ask any specific questions that arise.




I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.


Backing-up Encryption Key multiple times does what?

Hi JFoushee,


In SQL Server Reporting Services (SSRS), a backup copy of the key is required for many routine operations, and enables us to reuse an existing report server database in a new installation. The following maintenance tasks require that you have a valid copy of the symmetric key:



  • Changing the service account for the Report Server service.

  • Migrating a Reporting Services installation to a different computer.

  • Configuring a new report server instance to share or use an existing report server database.


We only need to back up one copy of the symmetric key. There is a one-to-one correspondence between a report server database and a symmetric key. We should backup the encryption keys when we configure a Reporting Services installation for the first time. We should also backup the keys any time we change the identity of the service accounts or rename the computer.

Reference: http://technet.microsoft.com/en-us/library/ms157275.aspx


There is a document about Reporting service ENCRYPTION KEY automated backup REPORT utility, you can refer to it.

http://blogs.msdn.com/b/selvar/archive/2013/03/27/reporting-service-encryption-key-automated-backup-report-utility.aspx


Hope this helps.


Regards,

Alisa Tang


If you have any feedback on our support, please click here.




Alisa Tang

TechNet Community Support




What am I doing wrong? Label text greater than

You are working with a string.


You need to convert to a number - i'd suggest an int


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


Karl




When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.

My Blog:http://unlockpowershell.wordpress.com

My Book:Windows PowerShell 2.0 Bible

My E-mail: -join ('6F6C646B61726C40686F746D61696C2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})


What am I doing wrong? Label text greater than

Here is one potential modified version of your code that should work, per Karl's suggestion.



protected void Page_Load(object sender, EventArgs e)
{
aginglabelvalue.Text = ((Label)FormView1.FindControl("aginglabel")).Text;
int num;
bool result = Int32.TryParse(aginglabelvalue.Text, out num);
if (result && num >= 0)
Image1.ImageUrl = "images/logo.png";
else
Image1.ImageUrl = "images/refresh.png";
}







- Brady My posts are kept as simple as possible for easier understanding. In many cases you can probably optimize or spruce up what I present. Have fun coding!


What am I doing wrong? Label text greater than

Hi JBo796,


You can convert a string to a number by using methods in the Convert class. Try the following code:



int i = Convert.ToInt32(aginglabelvalue.Text);
if (i >= 0)//(i==0)
Image1.ImageUrl = "images/logo.png";
else
Image1.ImageUrl = "images/refresh.png";





We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


version 2008 and 2013

Running a .Net program totally depends on which version of .Net framework it is targetting.


If the version is installed on the machine then it will run.




Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.


Question about linq to sql query in C#

Hi YoniAv,


Here is a nice topic you can refer to, http://www.georeference.org/doc/manifold.htm#sample_queries.htm


This topic lists queries that are part of the Nwind database, with some minor adjustments for Manifold SQL.




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


Question about linq to sql query in C#

here is the query



var q =
from c in db.Customers
join o in db.Orders on c.CustomerID equals o.CustomerID
join e in db.Employees on c.City equals e.City
join od in db.Order_Details on o.OrderID equals od.OrderID
join p in db.Products on od.ProductID equals p.ProductID
orderby p.ProductName
select new
{
e.FirstName,
c.ContactName,
od.ProductID,
p.ProductName,
od.UnitPrice,
od.Quantity
};


foreach (var v in q)
{
Console.WriteLine("{0}, {1}, {2}, {3},{4}", v.FirstName, v.ContactName, v.ProductID, v.UnitPrice, v.Quantity);
}





Please mark as answer, if you find this post helpful. Thanks Deepak Kalra


Help: Form.show() fails with exception

The COM components probably want the parent window handle to be fully initialized for some reason. My suggestion is in the load event, add a handler for either the Application being Idle (http://msdn.microsoft.com/en-us/library/system.windows.forms.application.idle(v=vs.110).aspx) or Form Activate ( http://msdn.microsoft.com/en-us/library/system.windows.forms.form.activate.aspx) When they are fired, remove the handler and open the form then.

Help: Form.show() fails with exception

Well I tried out the activate and the form does load but none of the object initialize.


I then tried using a timer to try and load the form a couple of seconds after the main form is visible.


This is what I received:


Cross-thread operation not valid: Control 'Main' accessed from a thread other than the thread it was created on.


Ok, so what is happening is that the form I am trying to load is somehow being loaded by a different thread and this is not allowed.


Any suggestions?


Help: Form.show() fails with exception

Hi Bonnie,


Nope doesn't work. Same issue with the threading I suppose.




Help: Form.show() fails with exception

What type of timer did you use? For windows forms you should use a System.Windows.Forms.Timer For WPF you need to use a DispatcherTimer. Each of these timers ensure the events fire on the UI thread. the system.timers.timer or system.threading.timer use a thread pool thread.

How to determine mouse position in zoomed image


public Form1()
{

InitializeComponent();
img = Image.FromFile( imagefilename );
zoom = ((float)pictureBox.Width / (float)img.Width) * (img.HorizontalResolution / g.DpiX);
}


protected override void OnMouseWheel(MouseEventArgs e)
{
float oldzoom = zoom;

if (e.Delta > 0)
{
zoom += 0.1F;
}

else if (e.Delta < 0)
{
zoom = Math.Max(zoom - 0.1F, 0.11F);
}



// ... some code



// handle selection box
if (rubberBandRect.Size.Width != 0) {
float ppd = img.HorizontalResolution / g.DpiX;


float a420x = ((float) rubberBandRect.X - oldImgX * oldzoom ) / oldzoom * ppd;
float a420y = ((float) rubberBandRect.Y - oldImgY * oldzoom ) / oldzoom * ppd;


float a3x = a420x / ppd * (zoom );
float a3y = a420y / ppd * (zoom );

float a6x = imgx * zoom;
float a6y = imgy * zoom;
float npx = a6x + a3x;
float npy = a6y + a3y;

rubberBandRect.X = (int) npx;
rubberBandRect.Y = (int) npy;

float oldWidth = rubberBandRect.Width / oldzoom * ppd;
float oldHeight = rubberBandRect.Height / oldzoom * ppd;

rubberBandRect.Width = (int) ((float) oldWidth / ppd * zoom);
rubberBandRect.Height = (int) ((float) oldHeight / ppd * zoom);
}



private void pictureBox_Paint(object sender, PaintEventArgs e)
{
GraphicsState save = e.Graphics.Save();
e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
e.Graphics.ScaleTransform(zoom, zoom);
e.Graphics.Restore( save );
}




Dynamic image displaying in WinRT

Hello Agha


If you are looking for image conversion from bitmap to stream or vice versa; you may have a look at my article if it helps you.


Good luck!


Arafat




Dynamic image displaying in WinRT

Hi, Agha


You can uses a file stream

(obtained using a file picker, not shown) to load an image source by calling SetSourceAsync . See the link below to get more information and see a example in the link:


http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.media.imaging.bitmapsource.setsourceasync.aspx<o:p></o:p>


Best Wishes!






We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



How to ask the user to set an app as the default program for a file extension?

Is it possible for an app to prompt the user to set it as the default program for a file extension?


Suppose an app is declared to handle .mp4 files. Is it possible for the app to bring up a dialog box for setting the default program for .mp4 files?




Hong


How To Create Dynamic SSRS RDL File????

Hi,


Try below links for some examples :


http://www.allaboutmssql.com/2013/01/ssrs-ismissing-visibility-function.html


http://social.technet.microsoft.com/wiki/contents/articles/19333.ssrs-how-to-set-column-visibility-property-for-many-columns-based-on-parameter-s-value.aspx




sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.


ssrs 2008 r2 The request failed with HTTP status 401: Unauthorized.

hello,


I created a report from one user who is owner of sharepoint site ,where sharepoint foundation site is installed.


but when i tried to access that report from another machine with same user owner of the site ,i received the error message as


the request failed with http status 401 unauthorized.


please help.


thanks


Monday, December 30, 2013

Compare two dictionary objects and add missing items from dict-2 to dict-1

Sure, you can use



serverReports.Remove(serverToRemove);

to remove an entire server from the dictionary or when looping through the servers in the dictionary, use



serverReports[item.Key].Remove(eventSourceToRemove);

to remove an eventsource for a specific server.


- HomeGrownCoder My posts are kept as simple as possible for easier understanding. In many cases you can probably optimize or spruce up what I present. Have fun coding!


Compare two dictionary objects and add missing items from dict-2 to dict-1

Hello HGC,



Sorry to bother you again, I have two filled dictionaries with me, one with ServerReport and other with EventConfig.



I need to remove the key or values when user deleted something in EventConfig dictionary. I knew that we can remove keys or values using below.



serverReports.Remove(serverToRemove);

serverReports[item.Key].Remove(eventSourceToRemove);



But, please advise on conditions like your foreach loop in MergeDictionaries() above.




Dropbox integration with window store app

You'll need to better explain the exact problem you're running into.


Matt Small - Microsoft Escalation Engineer - Forum Moderator

If my reply answers your question, please mark this post as answered.



NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.


How to get javascript value into Windows surface app..(same like NativeBridge in iOS)

Dear All,

I am doing some WebView once I am navigate particular page I am not able to get any JavaScript value..

needs to make some changes or is there any way where we can find this value

I mean in iOS they have some "NativeBridge" so that they can able to get value so same into Windows Surface how I can get this value..

I had many tried with google and all the event but there is no clue..





Thank you,

-Jitendra Jadav.


Jitendra Jadav


Display multiple center points on a global map

Hi ajolson1964,


According to your description, you want to use legend to display the summary of each Job Function. After testing the issue in my local environment, I guess that you have chosen the Color Analytical Map as PolygonLayer1 in the Map Layer pane. Based on my research, we should change it to Bubble Map and use bubble sizes to visualize the [Job Function] field. For more details, please see the steps below:



  1. Click the map. Right click the Polygon icon in the Map Layers pane to select “Layer Wizard”.

  2. Choose “Bubble Map” as the map visualization.

  3. Click several “Next” to go to “Choose color theme and data visualization” dialog box.

  4. Click “Use bubble sizes to visualize data”, then select [Job Function] field in the Data field.

  5. Click “Finish”. Then it will automatically show the center points in the map.




The following screenshot is for your reference:



The document below about create a map report step by step is for your reference:

http://technet.microsoft.com/en-us/library/ee240828.aspx



If you have any other questions, please feel free to ask.



Thanks,

Katherine Xiong




Katherine Xiong

TechNet Community Support



Problem while uploading PDF files.

varbinary(50) for PDF file looks like too small. I would use varbinary(max) instead.


Also, why name column is varbinary(50)?




For every expert, there is an equal and opposite expert. - Becker's Law





My blog




My TechNet articles




How to create a function to output Any recordset into JSON format?

I want to create a T-SQL function,to output "ANY" recordset into JSON format.That means,this function needs two parameters,the first is the recordset and the second is output json parametername.For example,I got a recordset with three columns("fieldA","fieldB","fieldC") and two rows("1","2","3";"a","b","c"),thus the function should output the json string like "datalist":[{"fieldA":"1","fieldB":"2","fieldC":"3"},{"fieldA":"a","fieldB":"b","fieldC":"c"}]("datalist" is the parametername).


Now the question:


1,How to pass a recordset as a parameter to a function?especially the recordset does NOT have a certain structure.


2,How could I get the structure(fields and their datatypes) from any recordset Such as a select sql?


Thanks


How to create a function to output Any recordset into JSON format?

I have solved The first question by pass the query string instead of the recordset.


now how can I get the fieldnames and the datatypes form "ANY" result dataset?NOT from a table.


How to create a function to output Any recordset into JSON format?

You need to put the resultset in a temporary table for that and then use catalog views to get column information from it.


Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs


How to create a function to output Any recordset into JSON format?

Why do you need to return JSON string from SQL Server? It is much easier to return a result set and create JSON in .NET.


For every expert, there is an equal and opposite expert. - Becker's Law





My blog




My TechNet articles


How to create a function to output Any recordset into JSON format?

Hi ,


Here is a really good example to implement the JSON parser and outputter. Can check here ==>


https://www.simple-talk.com/sql/t-sql-programming/consuming-json-strings-in-sql-server/





Regards Harsh


How to make snapped view for a viewbox

Sir here is the snapped view. And the second picture shows the original picture.





pratik


Document Complete Event Is not Raising in Internet explorer 11


using System;
using System.Windows.Forms;
using SHDocVw;

namespace IE11_POC
{
public partial class Form1 : Form
{
InternetExplorer IE;

public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

IE = new InternetExplorer();
IE.Visible = true;

IE.DocumentComplete += IE_DocumentComplete;
IE.Navigate("http://stackoverflow.com/");

}


void IE_DocumentComplete(object pDisp, ref object URL)
{
MessageBox.Show(URL.ToString());
}

}
}



Got one very weird scenario on Internet explorer 11. I have written one C# automated program for Internet explorer which was working fine till IE 10, now suddenly from IE 11, document complete stopped to raise more them 8 out of 10 times.


Just take an example of above code.


it will show Message box for the first time then it will never show that.



Document Complete Event Is not Raising in Internet explorer 11

Hi,


This is strange, it works fine on my machine(Win8.1, IE11). Every time I click, the URL is navigated, and then the DocumentComplete method will be called. Actually the event will be fired twice the first time I click the button.


There is a saying that the DocumentComplete event will not be fired when you set Visible to false, but I'm not sure if IE11 still has this problem:


BUG: DocumentComplete Does Not Fire When WebBrowser Is Not Visible


Please check if you set it to false in your original code.


And please check if the solution in this thread works:


Only DocumentComplete not fired - on some computers




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


How can i send and receive sms from windows application without using any third party API?

Hi Faisal Z


1) If you are living in India then you cannot send bulk SMS from your regular sim card as per TRAI's instruction and also not to send more than 200 SMSes in a day per sim card.


2) The hard work and research involved in the task you want to accomplish is much higher than paying third party . SMS vendors (so called third parties) provide cheap and efficient solution to your task. The API's provided by them are easier to implement in your application.


Well there are devices available in the market which provide SIM interface and custom API's to accomplish your job but they are expensive as far as I know.


I'll not underestimate you in your adventure.


Hard work is the key for success. All the best.


How can i send and receive sms from windows application without using any third party API?

Hi Faisal Z,


The C# implementation of the code is as follows:



using System;
using System.Threading;
using System.ComponentModel;
using System.IO.Ports;

public class SMSCOMMS
{
private SerialPort SMSPort;
private Thread SMSThread;
private Thread ReadThread;
public static bool _Continue = false;
public static bool _ContSMS = false;
private bool _Wait = false;
public static bool _ReadPort = false;
public delegate void SendingEventHandler(bool Done);
public event SendingEventHandler Sending;
public delegate void DataReceivedEventHandler(string Message);
public event DataReceivedEventHandler DataReceived;

public SMSCOMMS(ref string COMMPORT)
{
SMSPort = new SerialPort();
SMSPort.PortName = COMMPORT;
SMSPort.BaudRate = 9600;
SMSPort.Parity = Parity.None;
SMSPort.DataBits = 8;
SMSPort.StopBits = StopBits.One;
SMSPort.Handshake = Handshake.RequestToSend;
SMSPort.DtrEnable = true;
SMSPort.RtsEnable = true;
SMSPort.NewLine = System.Environment.NewLine;
ReadThread = new Thread(
new System.Threading.ThreadStart(ReadPort));
}

public bool SendSMS(string CellNumber, string SMSMessage)
{
string MyMessage = null;
//Check if Message Length <= 160
if (SMSMessage.Length <= 160)
MyMessage = SMSMessage;
else
MyMessage = SMSMessage.Substring(0, 160);
if (IsOpen == true)
{
SMSPort.WriteLine("AT+CMGS=" + CellNumber + "r");
_ContSMS = false;
SMSPort.WriteLine(
MyMessage + System.Environment.NewLine + (char)(26));
_Continue = false;
if (Sending != null)
Sending(false);
}
return false;
}

private void ReadPort()
{
string SerialIn = null;
byte[] RXBuffer = new byte[SMSPort.ReadBufferSize + 1];
string SMSMessage = null;
int Strpos = 0;
string TmpStr = null;
while (SMSPort.IsOpen == true)
{
if ((SMSPort.BytesToRead != 0) & (SMSPort.IsOpen == true))
{
while (SMSPort.BytesToRead != 0)
{
SMSPort.Read(RXBuffer, 0, SMSPort.ReadBufferSize);
SerialIn =
SerialIn + System.Text.Encoding.ASCII.GetString(
RXBuffer);
if (SerialIn.Contains(">") == true)
{
_ContSMS = true;
}
if (SerialIn.Contains("+CMGS:") == true)
{
_Continue = true;
if (Sending != null)
Sending(true);
_Wait = false;
SerialIn = string.Empty;
RXBuffer = new byte[SMSPort.ReadBufferSize + 1];
}
}
if (DataReceived != null)
DataReceived(SerialIn);
SerialIn = string.Empty;
RXBuffer = new byte[SMSPort.ReadBufferSize + 1];
}
}
}

public bool SendSMS(string CellNumber, string SMSMessage)
{
string MyMessage = null;
if (SMSMessage.Length <= 160)
{
MyMessage = SMSMessage;
}
else
{
MyMessage = SMSMessage.Substring(0, 160);
}
if (IsOpen == true)
{
SMSPort.WriteLine("AT+CMGS=" + CellNumber + "r");
_ContSMS = false;
SMSPort.WriteLine(
MyMessage + System.Environment.NewLine + (char)(26));
_Continue = false;
if (Sending != null)
Sending(false);
}
return false;
}

public void Open()
{
if (IsOpen == false)
{
SMSPort.Open();
ReadThread.Start();
}
}

public void Close()
{
if (IsOpen == true)
{
SMSPort.Close();
}
}

}

Then use the code as below:



SMSEngine = new SMSCOMMS("COM1");
SMSEngine.Open();
SMSEngine.SendSMS("919888888888","THIS IS YOUR MESSAGE");
SMSEngine.Close();

For more information about this sample code, see:http://www.codeproject.com/Articles/19023/Sending-SMS-using-NET





We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


How can i send and receive sms from windows application without using any third party API?

see the line below


http://social.msdn.microsoft.com/Forums/vstudio/en-US/ea2cc48c-0cef-4e40-ac27-71007096d854/send-sms-with-c?forum=csharpgeneral




Please mark as answer, if you find this post helpful. Thanks Deepak Kalra


Problem while uploading PDF files.

Problem while uploading PDF files.

The way to solve this problem is to read the error message. It tells you that you have a type mismatch somewhere. From what you posted, we know that the column data is varbinary(50). Apparently, in your client code you have defined the parameter as varchar. Whence the mismatch.


The question remains what you actually have in the value you pass. Is that a byte strem or what is it? To wit, varbinary(50) is not a good type for storing PDF documents, since few if any PDF documents are less than 50 bytes in size.


I happen to have some sample code for loading blobs:

http://www.sommarskog.se/blobload.txt





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

Problem while uploading PDF files.

Thanx for your help :)



amature.


How to make snapped view for a viewbox

Hey,


I have used viewbox for my application in snapped view I want to navigate to another page. Basically in 8.1 there is no fixed snapped view or something so how do I go about doing it?




pratik


How to make snapped view for a viewbox

Can you please explain in more detail what you are trying to do. Snapped view and navigation aren't generally related.


Windows 8.1 apps don't have explicit view states, but they can get the same effect by defining their own views based on the window size. See Quickstart: Designing apps for different window sizes


How to make snapped view for a viewbox

Hey thanks for the quick reply here is the XAML please do have a look and suggest



<Page
x:Class="Calculator_Hub.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Calculator_Hub"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" Loaded="Page_Loaded">

<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Viewbox>
<Canvas Height="768" Width="1366">
<Canvas.Background>
<ImageBrush ImageSource="Assets/hub.jpg"/>
</Canvas.Background>
<Button x:Name="Simple_Interest" BorderThickness="0" Content="" Height="253" Canvas.Left="113" Canvas.Top="131" Width="242" Click="Simple_Interest_Click"/>
<Button x:Name="Calculator" Content="" BorderThickness="0" Height="253" Canvas.Left="375" Canvas.Top="131" Width="239" Click="Calculator_Click"/>
<Button x:Name="Temperature" Content="" Height="253" BorderThickness="0" Canvas.Left="635" Canvas.Top="131" Width="241" Click="Temperature_Click"/>
<Button x:Name="BMI" Content="" Height="252" Canvas.Left="113" BorderThickness="0" Canvas.Top="407" Width="242" Click="BMI_Click"/>
<Button x:Name="Age" Content="" Height="252" Canvas.Left="375" Canvas.Top="407" BorderThickness="0" Width="239" Click="Age_Click"/>
<Button x:Name="Compound" Content="" Height="252" Canvas.Left="635" Canvas.Top="407" BorderThickness="0" Width="241" Click="Compound_Click"/>
</Canvas>
</Viewbox>
<VisualStateManager.VisualStateGroups>

<!-- Visual states reflect the application's view state -->
<VisualStateGroup x:Name="ApplicationViewStates">
<VisualState x:Name="FullScreenLandscape"/>
<VisualState x:Name="Filled"/>

<!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
<VisualState x:Name="FullScreenPortrait"/>

<!-- The back button and title have different styles when snapped -->
<VisualState x:Name="Snapped"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>

</Grid>
</Page>





pratik


Problem with Mailbox

What is the problem with the codes? I am using administrator account to send out the mail, while the exchange server is working fine as I am able to receive/send out mails. Do you know what the problem is with the port number?


Many Thanks & Best Regards, Hua Min


Problem with Mailbox

Many thanks. Is it to ensure 587 port is open there?



Yes, I am putting the administrator password below


...
SmtpClient client = new SmtpClient("my-friend.co", 587);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = true;
client.Credentials = new System.Net.NetworkCredential("Administrator@my-friend.co", "????");
...





right now, I still get this exception and stacktrace.

Mailbox unavailable. The server response was: 5.7.1 Unable to relay

at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)


Many Thanks & Best Regards, Hua Min


Timer Skips a Second

Hey guys,


I'm trying to get my timer to measure seconds but it skips two seconds if I press stop and three times if I press stop again etc.




timer = new DispatcherTimer();
ts = new TimeSpan(1000000);
timer.Interval = ts;

private async void btnBegin_Click(object sender, RoutedEventArgs e)
{
if (hasBegun == false)
{
if (cmbxSubjects.SelectedValue != null && cmbxActivities.SelectedValue != null)
{
timer.Start();
timer.Tick += timeData_Tick;
btnBegin.Content = "Stop";
hasBegun = true;
btnLogSession.IsEnabled = false;
}

else if (cmbxSubjects.SelectedValue == null || cmbxActivities.SelectedValue == null)
{
await pleaseEnterAllFields.ShowAsync();
}
}

else
{
btnLogSession.IsEnabled = true;
btnBegin.Content = "Start";
hasBegun = false;
timer.Stop();
}
}

public void timeData_Tick(object sender, object e)
{
if (seconds == 60)
{
seconds = 0;
lblSeconds.Text = seconds.ToString();

minutes++;
lblMinutes.Text = minutes.ToString();
}

else if (seconds < 60)
{
seconds++;
lblSeconds.Text = seconds.ToString();
}

if (minutes == 60)
{
minutes = 0;
lblMinutes.Text = minutes.ToString();

hours++;
lblHours.Text = hours.ToString();
}

totalSeconds++;
}

How can I fix it?


Timer Skips a Second

If it is constantly less 1 second then the easy fix will be


if (second < 61)


instead of


if (second < 60)


chanmm




chanmm


How to create a function to output Any recordset into JSON format?

I want to create a T-SQL function,to output "ANY" recordset into JSON format.That means,this function needs two parameters,the first is the recordset and the second is output json parametername.For example,I got a recordset with three columns("fieldA","fieldB","fieldC") and two rows("1","2","3";"a","b","c"),thus the function should output the json string like "datalist":[{"fieldA":"1","fieldB":"2","fieldC":"3"},{"fieldA":"a","fieldB":"b","fieldC":"c"}]("datalist" is the parametername).


Now the question:


1,How to pass a recordset as a parameter to a function?especially the recordset does NOT have a certain structure.


2,How could I get the structure(fields and their datatypes) from any recordset Such as a select sql?


Thanks


How to create a function to output Any recordset into JSON format?

I have solved The first question by pass the query string instead of the recordset.


now how can I get the fieldnames and the datatypes form "ANY" result dataset?NOT from a table.


How to create a function to output Any recordset into JSON format?

You need to put the resultset in a temporary table for that and then use catalog views to get column information from it.


Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs


How to create a function to output Any recordset into JSON format?

Why do you need to return JSON string from SQL Server? It is much easier to return a result set and create JSON in .NET.


For every expert, there is an equal and opposite expert. - Becker's Law





My blog




My TechNet articles


How to create a function to output Any recordset into JSON format?

Hi ,


Here is a really good example to implement the JSON parser and outputter. Can check here ==>


https://www.simple-talk.com/sql/t-sql-programming/consuming-json-strings-in-sql-server/





Regards Harsh


How to update date in a table from another database

Thank you!

TemplateBinding to SolidColorBrush won't work when overriding Button ControlTemplate

Hi, I want to create a custom control which will extend the build-in Button and allow user to set the pointer-over Background color. I have added a dependency property of type Brush, and "properly" set the binding in the according visual state of ControlTemplate using TemplateBinding. But it still won't work - when I move mouse over the button, nothing happens.


Here is code:


[Generic.xaml](I've bolded the font of all the related code. )



<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App38">

<Style TargetType="local:ButtonEx">
<Setter Property="Background"
Value="{ThemeResource ButtonBackgroundThemeBrush}" />
<Setter Property="Foreground"
Value="{ThemeResource ButtonForegroundThemeBrush}" />
<Setter Property="BorderBrush"
Value="{ThemeResource ButtonBorderThemeBrush}" />
<Setter Property="BorderThickness"
Value="{ThemeResource ButtonBorderThemeThickness}" />
<Setter Property="Padding"
Value="12,4,12,4" />
<Setter Property="HorizontalAlignment"
Value="Left" />
<Setter Property="VerticalAlignment"
Value="Center" />
<Setter Property="FontFamily"
Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontWeight"
Value="SemiBold" />
<Setter Property="FontSize"
Value="{ThemeResource ControlContentThemeFontSize}" />

<Setter Property="PointerOverBackground"
Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" />


<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:ButtonEx">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
Storyboard.TargetName="Border">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{TemplateBinding PointerOverBackground}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
Storyboard.TargetName="ContentPresenter">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
Storyboard.TargetName="Border">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource ButtonPressedBackgroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
Storyboard.TargetName="ContentPresenter">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
Storyboard.TargetName="Border">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource ButtonDisabledBackgroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush"
Storyboard.TargetName="Border">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource ButtonDisabledBorderThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
Storyboard.TargetName="ContentPresenter">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused"/>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="Border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Margin="3">
<ContentPresenter x:Name="ContentPresenter"
AutomationProperties.AccessibilityView="Raw"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
Content="{TemplateBinding Content}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>

</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>



[ButtonEx.cs]



using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;


namespace App38
{
public sealed class ButtonEx : Button
{
public SolidColorBrush PointerOverBackground
{
get { return (SolidColorBrush)GetValue(PointerOverBackgroundProperty); }
set { SetValue(PointerOverBackgroundProperty, value); }
}
public static readonly DependencyProperty PointerOverBackgroundProperty =
DependencyProperty.Register("PointerOverBackground", typeof(SolidColorBrush), typeof(ButtonEx), new PropertyMetadata(null));


public ButtonEx()
{
this.DefaultStyleKey = typeof(ButtonEx);

}
}
}




Oracle query taking more time in SSRS

Hi Surendra,



Based on the current description, I understand that you may use Oracle Provider for OLE DB to connect Oracle database. If so, I suggest you using Microsoft OLE DB Provider for Oracle to compare the query time between SQLPlus and SSRS.


Here is a relative thread (SSRS Report with Oracle database performance problems) for your reference.



Hope this helps.



Regards,

Heidi Duan


If you have any feedback on our support, please click here .




Heidi Duan

TechNet Community Support



Oracle query taking more time in SSRS

We have only read access to Oracle reporting DB .


Surendra Thota


Oracle query taking more time in SSRS

Hi All


there is a work around to keep the index Hints . once you have created the dataset ,later open the same datset in Expression mode which is formated by the query designer and write your query which contains Hints. It is working for me .




Surendra Thota


Oracle query taking more time in SSRS

It is enough , having a stored procedure in SQL Server that reads the data from the Oracle database.


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



MS SQL optimization: MS SQL Development and Optimization

MS SQL Consulting: Large scale of database and data cleansing

Remote DBA Services: Improves MS SQL Database Performance

SQL Server Integration Services: Business Intelligence


Oracle query taking more time in SSRS

Hi Surendra,


Thanks for your posting.


I am glad to hear that you have resolved the issue and share it to the forum. It will be benefit for whom have similar issue to resolve.


Regards,

Heidi Duan


If you have any feedback on our support, please click here .




Heidi Duan

TechNet Community Support



Error:does not contain a definition for '' and no extension method

The shown class ‘public class AHPModel { . . . }’ does not contain anything about AddCriteria, therefore model.AddCriteria(criteria) does not have sense. Maybe you have a separate function in another file and namespace, like ‘void AddCriteria(this AHPModel model, double [][] criteria)’? Or maybe there is another AHPModel class, which you want to test, but which is fully defined in another place.


Do you have AddCriteria or AHPModel in other places?


Error:does not contain a definition for '' and no extension method

yes I have another project but it is not executable , so i had to make a new project and call (Addcriteria) and (Addratedchoices) in it , in order for it to be executable.


Error:does not contain a definition for '' and no extension method

so , how can i fix it ?


can you please tell me exact steps, because i am a beginner?


Error:does not contain a definition for '' and no extension method

If you want to test AHPModel class which is in another project, then you can add a reference to that project (http://msdn.microsoft.com/en-us/library/wkze6zky.aspx). The class and members must be accessible, i.e. public.


Since you are using NUnit, then also consult the corresponding documentation and samples.


Visual Studio includes tools for Unit Testing: http://msdn.microsoft.com/en-us/library/dd264975.aspx, http://www.microsoftvirtualacademy.com/training-courses/software-testing-with-visual-studio-2012-exam-70-497-jump-start?mtag=MVP4000065


Error:does not contain a definition for '' and no extension method

they are all gone now , but i still have an error about one reference (GeneralMatrix),


i have referenced it in the beginning but it is still giving an error that it is not found.


i don't know why!!


Setting BorderBrush color of backButton

When I set the BorderBrush color of the backButton in Properties it does not show ; borderBrush stays white on the screen in the design window and at runtime.


Is there a workaround ?


I could replace it by a graphic but rendition is not satisfactory.


I am using VB


Thank you.











Setting BorderBrush color of backButton

I am trying to change the circular button with a left arrow that appears at the upper left corner of BasicPages. Foreground color changes the color of the arrow fine, but border color brush does not. I tried to edit the template as you describe, but the button changes to a tiny square and becomes unusable.


I will see if I can change the AppBarButton style.


If I find no other way, I will use graphics captured from the screen and switched to negative to simulate the button.


Is there a way to serialize my objects to XAML in Windows Store applications?

Is there a way to serialize my objects to XAML in Windows Store applications? I've searched wherever I could, and found nothing... I need something like the methods inside System.Xaml.XamlServices.

Is there a way to serialize my objects to XAML in Windows Store applications?

Hi Shayan,


If you search for "serialize" in the search box in the top right of the Windows Store apps dev center you'll get hits on .Net serialization classes you can use in your Windows Store app. You can also use the Object Browser inside Visual Studio to find such classes.


Likewise if you follow the "samples" link in the dev center and search for "serialize" there are a number of samples available.


--Rob


Is there a way to serialize my objects to XAML in Windows Store applications?

What do you mean by serialize to and deserialize from XAML? It would help if you could provide more clear examples of what you are trying to do.


There is a XamlReader class which can load a Xaml fragment into an object tree. There is no analogous writer, but you can serialize and deserialize your data objects to XML and rebuild a Xaml tree based on that.


--Rob


Is there a way to serialize my objects to XAML in Windows Store applications?

You'll have to implement it yourself. You'll need to iterate the visual tree to find the controls and then can serialize them with XML classes. The big trick will be determining which properties are essential to set and which can be left for default.


--Rob


Sunday, December 29, 2013

SSRS Operation is not valid due to the current state of the object

It seems in the last week something has changed on all my customers that are running SSRS and I am no getting this error in various reports when changing interactive parameters, these reports have been working for years, so I’m assuming there was a Microsoft update of some sort, has anyone else ran into this.


Thanks in Advance


SSRS Operation is not valid due to the current state of the object

Same issue here. No idea what's wrong.

SSRS Operation is not valid due to the current state of the object

Thanks guys.

SSRS Operation is not valid due to the current state of the object

Here is a suggested solution I found on another post. It works well on mine.


You don't have to uninstall the patch; the default value of MaxHttpCollectionKeys is set to 1000 by the security patch. You can override the value by adding the following key to the appsetttings section in your SSRS report manager web.config file (usually in Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportManager)


<add key="aspnet:MaxHttpCollectionKeys" value="10000" />


10000 is just a suggestion, you can set it to the value of your liking.


We did this change and the reports worked for us.


Regards,


Sri


sending an email

I would like help on how to send an email to a particular user whenever a row is added to the table in the database.

sending an email

You can create an insert trigger on the table and from in the rigger code use sp_send_dbmail in the msdb to send the email (and of course first configure database mail).


Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi

sending an email

Check out this link. I gave an example on when to send the email and how.



http://social.technet.microsoft.com/Forums/en-US/transactsql/thread/762af02d-5b7f-467d-bf9a-0bb5c4fac4cb


Abdallah, PMP, ITIL, MCTS

Cannot print text with style from Rich Edit Box


  1. I used Print API of Window RT API to print canvas but it cannot print text with style from Rich Edit Box. Is there any way to print text with style?

  2. To workaround, we used Render Target Bitmap to render RichEditBox to a image and add it to canvas. The problem is it cannot run through RenderAsync() method. I think it need to be deferred to wait RenderAsync() but I cannot find any deferral for Print. Do you have any ideas about it?


ssrs 2012 want to chage paper size to letter size paper

In a ssrs 2012 dashboard application, I have a question about how ssrs automatically determines the length of paper that is required to print some of the reports. In one ssrs 2012 report in particular, 50% of the columns are not visible when the report is

exported to pdf or word. The problem is the page length is longer than legal size paper. There is no way that the exported report needs that size of paper.


Thus can you tell me how to modify the ssrs report so that it needs only letter size paper?


ssrs 2012 want to chage paper size to letter size paper

Your link is a good general location. However it does not state what to do when there are lots of invisible columns.


How can I deal with page printing when there are a large volume of invisible columns?


ssrs 2012 want to chage paper size to letter size paper

Ah, the old hidden column issue... I am assuming what you mean by 'invisible' is that you are hiding some columns?


You might want to check this thread. I had the same issue... unfortunately at the time there was no workaround - the pagination treated hidden columns as if they were still there, and every second page in my report turned out blank.. nothing i could do.


However apparently it might be fixed now..


http://social.msdn.microsoft.com/Forums/sqlserver/en-US/9ee3f759-229d-45c2-9e41-5fa794e6aa2b/will-ssrs-2008-eliminate-white-space-due-to-hidden-columns?forum=sqlreportingservices




Thanks! Josh


ssrs 2012 export to comma delimited (csv) file problem

I will ask the person who takes care of the report server to change the config file as you directed.


Also what happens on an csv (comma delimited export) when there is no data to export? Will there be no file generated? Will the file be empty?


Get original URL for Link to a Document content type

Hello,


I'm having a SharePoint doc library with ItemAdded event receiver attached to it and "Link to a Document" content type enabled. My general question is:


How to get URL that the link points to?


I'll show you how I'm trying to achieve that:



SPWeb parentWeb = properties.Web;
if (properties.ListItem.ContentType.Name == LinkContentTypeName)
{
object urlFieldValue = properties.AfterProperties["URL"];
if (urlFieldValue != null && urlFieldValue.ToString() != String.Empty)
{
// continue
}
}

But I always get null so I can't even get inside IF statement. I've tried to install ItemAdded event receiver as synchronous, but it didn't make a difference. I'd appreciate any ideas.


Regards


Tomasz


Get original URL for Link to a Document content type

Given you are capturing ItemAdded in document library most likely youare AfterProperties will always be null. Read the following blog post. Though its written for MOSS 2007 I am assuming this will stay the same for SP2010.


http://www.synergyonline.com/Blog/Lists/Posts/Post.aspx?ID=122


Instead use this code and see if it works



SPListItem item = Properties.ListItem;

SPFieldUrlValue itmURL = new SPFieldUrlValue();

if(!String.IsNullOrEmpty(item["URL"]))
{
itmURL = item["URL"];
String URLDesc = itmURL.Description;
String URL = itmURL.Url ;
}






Amit


How to populate active directory users in to drop down list items dynamically in Share point 2010 ?

You can use OOTB feature person or group column, however you can try some options available at this link


http://social.msdn.microsoft.com/Forums/en-US/cd4f709d-6884-4413-98fc-0f3850bc770b/populate-drop-down-list-of-sharepoint-users


http://sharepoint.stackexchange.com/questions/49709/list-of-users-in-dropdownlist-at-adding-form






Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL

INSQLSERVER.COM Mohammad Nizamuddin