Thursday, July 31, 2014

IndexerOption in QueryOptions class is not working

Hi Balaji,


I can understand your question, but I can't reproduce the issue. UseIndexerWhenAvailable gave me a correct result.


I have 12 files in my Picture library among them I got only 4 Images contains "12" in the name, I set my UserSearchFilter as "12" and I got a correct amount.


By the way Advanced Query Syntax (AQS) does not only filter for name but also filter for other properties for instance height, width, tag and etc, you may need to see if your files contains "hello" in somewhere.


--James




<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>

Thanks

MSDN Community Support



Please remember to "Mark as Answer" 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.


StreamSocket Disconnection handling in Universal app (Client)

Can anyone help with how to detect disconnections on StreamSocket in C# Universal App I am developing for WP8 and Store.


I have already gone though various resources online and I do understand that in case of conditions like going out of WiFi range, switching off WiFi or other kinds of abrupt disconnections, I cannot rely on the read operation returning with a 0 length read.


What I cannot understand is the fact that even when I try to write to StreamSocket during such a disconnection situation, I am not getting any exception.


I am using the InputStream and OutputStream properties of StreamSocket directly for read and write. My write code is as follows



socket.OutputStream.WriteAsync(dataBuffer);
socket.OutputStream.FlushAsync();

Neither of these lines is throwing an exception. I also put handlers on the async operations and both operations have status Completed.

So how do I detect disconnection. My custom binary messaging protocol includes a health check message which gets sent every 5 sec and the connection is reset when there is no response for 15 sec. What I expected is that there would be some sort of detectable failure when the write is done, but its not happening.


As my client is sensitive to time, I need to be able to detect disconnections as and when it happens and initiate reconnection if required.





Custom Field FieldControlCollection

Hi,


Do you want to disable control in the Edit Form?


If yes, as a workaround, the control could be disabled or hidden using JavaScript or SharePoint Manager. So, it is not necessary to get the control name in the code behind.


More information about how to disable the control, please refer to the link below about hiding columns using SharePoint Manager:


http://ift.tt/1ofMyjY


Also please provide us more detailed information, it will be easier for us to find a solution for you.


Thanks


Patrick Liang


Forum Support


Please remember to mark the replies as answers if they

help and unmark them if they provide no help. If you have feedback for TechNet

Subscriber Support, contact
tnmff@microsoft.com






Patrick Liang

TechNet Community Support



MailMessage() does not accept 2 arguements C#

I get the above when do this:





MailMessage mm=new MailMessage(senderAddress, recipientAddress);

Error 2'Nazarene.Admin.Occupants.MailMessage' does not contain a constructor that takes 2 argumentsC:\Users\VenezuelanH\Desktop\Internship Projects\Original\Nazarene\Nazarene\Admin\Occupants\MailMessage.aspx.cs45 30Nazarene


Unable to send attachment via email



I have been trying to send an email in C# (below is the code).
I want to send an attachment with this email. When I run this code in my debugger with its instance of IIS it works fine
however, when I run it through our IIS 7 server it gets stripped off.
We have checked our anti virus and that is not the issue, I have run it
with both the credential code commented in and out and no change.
any ideas why i cannot get an attachment through our IIS server?



MailMessage message = new System.Net.Mail.MailMessage();

message.To.Add("test@test.com");
message.Subject = "Project Created";
message.From = new MailAddress("helpdesk@test.com");
message.Body = "You have received a project request from " + TxtContactName.Text + " Project Name: " + TxtProjectName.Text + " Priority: " + DDLPriority.SelectedValue.ToString() + " Business Area: " + DDLBusinessArea.SelectedValue.ToString();

if (FileUpload1.FileName.Length > 0)
{
if (File.Exists(FileUpload1.PostedFile.FileName))
message.Attachments.Add(new Attachment(FileUpload1.PostedFile.FileName, MediaTypeNames.Application.Octet));

}

SmtpClient smtp = new SmtpClient("10.1.1.118");
smtp.Credentials = CredentialCache.DefaultNetworkCredentials;
//NetworkCredential cred = new NetworkCredential();
//cred.UserName = test@test.com;
//cred.Password = "test1";
//cred.Domain = "test.com";

//smtp.UseDefaultCredentials = false;
//smtp.Credentials = cred;
//smtp.DeliveryMethod = SmtpDeliveryMethod.Network;

smtp.Send(message);










Is there any possibility to keep configuration related information somewhere else other than the “AppName.exe.config”?

Hi, thanks for your reply !

Is there any possibility to keep configuration related information somewhere else other than the “AppName.exe.config”?

Hi, thanks for your reply, I am looking into it !

Is there any possibility to keep configuration related information somewhere else other than the “AppName.exe.config”?

Why don't you just use Linq-2-XML and read the XML file? It don't get any simpler than that.

Is there any possibility to keep configuration related information somewhere else other than the “AppName.exe.config”?

Hi Michael, I am sorry if it created confusion but actually the application I am working on is not developed by me, under maintenance I am just trying to achieve the requirement specified by stakeholder.


I will try to explain a bit more, hope that would help -


I have main exe application is based on MFC and the another one is based on C# WPF hosted by the main exe application. Now what I see is that the configuration needed by main exe app and hosted app is written in App.exe.config. I was looking for if there is any possibility to keep the configuration related to that hosted application out of the App.exe.config file. I was looking if there is a possibility to achieve this via configuration and I tried "lincedConfiguration", "ConfigSource" etc. but no success. During further investigation I saw that to bridge managed and unmanaged app there is a mixed mode code, where I found the "Bootstrapper.Run()" which I further understood is responsible to load the modules specified in the "App.exe.config". And then based on the suggestion of Linq-2-XML thought I would read the xml but not sure how to create the instance of the module specified in xml (as I have no experience in all this).


It's complex and I know that the problem exists is because of the way they have defined to configure the system. I have other alternatives to solve it but those are just tricks. I had no much idea about the app.config and all so wanted to dig out the information and possibilities about what things can we do with it, to learn it, and thanks to you all for your valuable time, suggestions, information and explanations.


Thank you very much !


- Prasad.






Problem of Uncertain no. of columns

You should not take your INSERT outside instead you need to build the INSERT along with column dynamically and execute the query. That should do the trick for you.


If you can provide DDL/DML/Sample data and your proc, we will be able to help you further.


Problem of Uncertain no. of columns

I think you can have a parameter of a number of columns in your procedure.



CREATE PROCEDURE uspProcedure
@param1 int,
@param2 int,
@numberOfColumns int
AS
IF @numberOfColumns = 1
begin
SELECT @param1
end
IF @numberOfColumns = 2
SELECT @param1,@param2


Problem of Uncertain no. of columns

Ok. you've two options in that case


1. use a temporary table with same structure as SP output and populate it as below



INSERT #Temp
EXEC Proc...

Now use temp table to fill your table



INSERT YourTable (col1,col2,col3,..)
SELECT Col1,NULL,Col2,...
FROM #Temp

fill missing columns with NULL values


2. use a direct select based on distributed query



INSERT YourTable (Col1,Col2,Col3,..)
Select Col1,NULL,Col2,..
from
OPENROWSET('SQLOLEDB','Data Source=Servername;Trusted_Connection=yes;
Integrated Security=SSPI','Execute yourdbname..Proc')





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c



How to implement poor-man's version control with TSQL queries


Should this work? It prints all the rows.



DECLARE @Projects TABLE
([id] int IDENTITY(1,1), [Project] varchar(1), [Version] int)
;

INSERT INTO @Projects
([Project], [Version])
VALUES
('A', 1),
('A', 2),
('A', 3),
('A', 4),
('B', 1),
('B', 2),
('B', 3),
('C', 1),
('C', 2),
('D', 1)
;


-- DECLARE @User varchar(100)

SELECT *
FROM @Projects p
WHERE
-- UserName = @User AND
NOT EXISTS (SELECT 1
FROM @Projects q
WHERE q.id = p.id
AND q.Version < p.Version)





siegfried heintze



Nope you have condition wrong


In my suggestion i've used > and you replaced it with <


it should be this



SELECT *
FROM @Projects p
WHERE
NOT EXISTS (SELECT 1
FROM @Projects q
WHERE q.project= p.projects
AND q.Version > p.Version)





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


Problem of Uncertain no. of columns

Use the full INSERT syntax:



INSERT INTO TABLE (Column1, Column2, Column3)

This allows you to tell the table where to put the data you're sending it, even when the result does not contain the same number of columns as the table.


To be frank you should ALWAYS insert like this, it makes it so much easier when you have to come back and revisit the script, and it also protects the script from future column additions.


Problem of Uncertain no. of columns

Hi Patrick,


May be I was not able to explain my problem. My issue is not what you have thought as what you have suggested is very basic thing to ask at the first place :-)


Let me explain once again and, it is a situation/requirement which I have to make click.


I have a table 'MyTable' (which has 'x' no. of columns, where 'x' is a fixed no.)


There is a procedure that provides rows to be filled into this table. Each row may not contain same no. of columns as in MyTable.


I hope I am clear now.


Any idea in this regard will be very helping.


Regards!




'In Persuit of Happiness' and ..... learning SQL.


How to implement poor-man's version control with TSQL queries

I have a table called Project. Each row completely describes a project and has a username, project name, project description and other numeric parameters that contain all the data about the project.


When multiple rows have the same username, this means a user owns multiple projects.


Now I want to implement a poor-man's version control for my users by adding a new integer column called version. When a user wants to save a new version of his project, the version is incremented and a new row is inserted into the table.


Some projects will have 1 version, others will have a dozen or more.


By default, the user should see a data grid of projects where only the latest version of the project is displayed (including the version count) and all the older versions of each project are ignored.


How do I write a TSQL query to populate this data grid (and ignore every version except the latest versions of each project)?


Thanks


Siegfried




siegfried heintze


How to implement poor-man's version control with TSQL queries

I hope your looking for this



--Create sample data

CREATE TABLE Projects
([Project] varchar(1), [Version] int)
;

INSERT INTO Projects
([Project], [Version])
VALUES
('A', 1),
('A', 2),
('A', 3),
('A', 4),
('B', 1),
('B', 2),
('B', 3),
('C', 1),
('C', 2),
('D', 1)
;


WITH CTE AS(
SELECT *, Row_Number()OVER(Partition by Project Order by version desc) ROWNUM
FROM Projects)
SELECT * FROM CTE WHERE ROWNUM=1





Satheesh

My Blog | How to ask questions in technical forum



How to implement poor-man's version control with TSQL queries

You just need a query like below




--You pass usernames through this parameter to get related project details
DECLARE @User varchar(100)
SELECT *
FROM Projects p
WHERE UserName = @User
AND NOT EXISTS (SELECT 1
FROM Projects
WHERE ProjectID = p.ProjectID
AND Version > p.Version)

I'm assuming your table will have fields as below


ProjectID - to indicate a project


Version - to store version info


Username - the user for the project




Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


How to implement poor-man's version control with TSQL queries

Should this work? It prints all the rows.



DECLARE @Projects TABLE
([id] int IDENTITY(1,1), [Project] varchar(1), [Version] int)
;

INSERT INTO @Projects
([Project], [Version])
VALUES
('A', 1),
('A', 2),
('A', 3),
('A', 4),
('B', 1),
('B', 2),
('B', 3),
('C', 1),
('C', 2),
('D', 1)
;


-- DECLARE @User varchar(100)

SELECT *
FROM @Projects p
WHERE
-- UserName = @User AND
NOT EXISTS (SELECT 1
FROM @Projects q
WHERE q.id = p.id
AND q.Version < p.Version)






siegfried heintze


Custom List Form - newform.aspx with code behind - beginner

It depends on how your users will interact with the list, are they going to use list newform.aspx to submit the data or will you be providing separate interface to submit the data. You can always go with custom webpart to incorporate all your business logic along with the interface required for end users.


building custom webparts in SharePoint 2010


http://ift.tt/1oTMtaJ


Custom List form


http://ift.tt/1k9q6cg




My Blog- http://ift.tt/1aw9F9W|

If a post answers your question, please click Mark As Answer on that post and Vote as Helpful


Custom List Form - newform.aspx with code behind - beginner

Hi Sapara Thanks, the thing is I am not so keen in using InfoPath as I have noticed that when there are so many controls on the Infopath form, the page becomes slow. I have to incorporate both the views and the code as well. But thanks for the suggestion.

Why the backgroundworker throw busy exception ?

Thomas here is the project in Zip ( WinZip )


The file name is: ScrollLabelZip.zip


ScrollLabelZip


RDL and SSRS

I am having difficulty finding SSRS for SQL2008 Express to download. Has this been integrated into another product or can I download and install it as a add-on to SQL 2008 Express? I've been searching for days.

RDL and SSRS

Hi,


SQL Server Developer, Standard, and Enterprise editions have full access to ssrs


express edition have limited access only




http://ift.tt/1n1lh96


RDL and SSRS

FormClosing event doesn't work as I want


Hi friends!

First, I have read other similar threads but I haven't seen a complete match.


It is my VB.NET app. I want the user to be logged out when a user closes the form/application by clicking the X at the right-top (to prevent the user from appearing to be online while not).


Now, I created a sub for LoggOff, put it in a module and call it whenever I want it. So I went to properties and double-clicked"Form Closing" event to write the code for FormClosing. Inside FormClose I call the "LogOff" sub explained above, ofcourse, now when the user clicks the big close 'X' at the top, he/she is logged off.But there is a problem;


The first form to load is the login form after which another form, say "Welcome" will be opened and "login" will be closed (by welcome.open, me.close), now the problem is, whenever me.close is executed, all the code in the FormClosing event is also run, which means terminating the application.


Whenever I just want to close one form and open another one (I don't want to just hide forms) the code will log the user off and close the application. How can I differentiate the closing of a user hitting the big X and the closing of a programmer with me.close???


Many thanks for any input.

Frank!





"I can do all things through Him who strengthens me"


How to get clients connected in WMS publishing point on windows server 2008 with c# coding.

Sorry to bother anyone about this question.


Can anyone knows how to retrieve amount of client connection to Windows Media Server in real time same as WMS does on server console by c# programming ?


I got logfiles of WMS in system32 directory for details but it must be off-line of all connections which will able to get those informations for doing anything,but in this case I want real time client connection at online when a client connects to WMS that I will get amout of that client also.




I have tried to search Windows Media Service SDK to develop this on my Windows 7 OS,but I did not find that really.


Can anyone knows this,please ?


Regards,


BigBerm



Localization Issue - auto generates code in form's designer file

Hi Smokyt,


I tested on my WinForm app, but did not see additional properties. I found an article about how to, can you please build a simple WinForm app and try it again? If the problem persists, you can post the project here using OneDrive. Thank you for understanding.


http://ift.tt/1zBjGen.


Regards,




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. &lt;br/&gt; Click &lt;a href=&quot;http://ift.tt/1y6LuGR; HERE&lt;/a&gt; to participate the survey.


HttpClient always send NTLM package

Is this the same scenario as your other thread?



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.


Help with breaking richtextbox contents into pages

Hi fake programmer,


Yes, you can definitely display the contents of rtf file in a richtextbox.


But I'm not quite understand how you break the richtexbox contents into pages, but if you can do this, we do have a API named RenderTargetBitmap class, by which you can give a screenshot for the current visual stuff.


Before you print the stuff, you can take screenshots for the visual contents of the richtextbox and pass them to the print page preview. For printing sample, ref: http://ift.tt/1bHxoxy


--James




<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>

Thanks

MSDN Community Support



Please remember to "Mark as Answer" 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.


Difference between two dates and hours

Hi,


According to your post, my understanding is that you wanted to calculate the difference between two times.


We can use the following formula to achieve it.


=TEXT(Date2-Date1,"hh:mm")



http://ift.tt/1ofHK4A


Thanks & Regards,


Jason


Jason Guo

TechNet Community Support



Area for Bingmap display white screen

Hi Sherazad,


Firstly, let’s verify the followings:



  1. How did you design BingMap in your SharePoint site?

  2. What permission do the problematic users have?

  3. Which version browser did the users use for SharePoint?


Please grant the problematic users 'Manage Personal Views' permission, compare the result.


Here is a similar post for you to take a look at:


http://ift.tt/1zBjoEc


Also, check if it is useful:


http://ift.tt/1AFwW3g


I hope this helps.


Thanks,


Wendy


Forum Support


Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.




Wendy Li

TechNet Community Support




Visual Basic 2010 line counter

As I stated I can't use a Label on the left. It is too difficult to attempt to work with in my opinion.


Well this seems to work.


Known Issues


The only noticeable issues I see is if you hold down an up or down arrow key to move the caret in RichTextBox2 (RTB2). RichTextBox1 (RTB1) and Label1 do not update while the arrow key is held down. Once the arrow key is let up then RTB2 will scroll to a new position if necessary and Label1 will update to the line the caret is currently on.


And for some reason VScrollBar1 may have room left between the scroll button and scroll stop at the top or bottom of the scroll after both RTB's are already at the top or bottom of the scroll if I remember correctly.


Controls


The Form contains four controls. A label (Label1), two RichTextBoxes (RichTextBox1 on the left and RichTextBox2 to the right of RTB1) and a VScrollBar (VScrollBar1).


RTB1 and RTB2 must use the same font, font size, font style AFAIK because that can affect the line height of a line which can make scroll values no longer equitable between the RTB's.


WordWrap can not be used.


They both require the same height as well as Forced horizontal scrollbars and NO vertical scrollbars. Their vertical scrollbar is handled by VScrollBar1.


RTB1 is set to not have a tabstop and as read only. By not having a tabstop the RTB1 will not focus when the app launches so RTB2 will have the caret blinking in it rather than having to select RTB2 to remove focus from RTB1.


Anchors are shown in the code except for Label1 which is anchored top/left. Label1 is recentered over RTB2 whenever its text changes.


If you set RTB1's width correctly it is unlikely you will ever need to use the forced horizontal scrollbar in it. However it has to be there since it effects vertical scrolling with regard to displaying RTB1's line number next to the appropriate line in RTB2. Therefore RTB2 also requires this scrollbar forced. Figuring that out was a headache. Anyhow if you don't want to see the forced horizontal scrollbar in RTB1 you can lay a panel over it to cover it and provide the panel with the same backcolor as the form or something.


Code


The code now displays in RTB1 and Label1 the first line of text in RTB2 as Line 1 rather than Line 0.


There are two Pinvoke functions used in the code at the top of it. They appear the same but actually have different variable types in them.


If you have any questions about the rest of the code then ask them and I will attempt to answer them.


Other


You can copy and paste text into RTB2.


The mouse can be used to select text for deletion however this does not move the caret when that is performed so when you release the mouse the Label shows information on where the caret is not where the mouse was released at.


As you press keys in RTB2 both RTB1 and Label1 update constantly.


You can delete all of the text in RTB2 and everything updates.


Images are just two animated .Gifs of app working. May need to zoom in with WebBrowser to see them better.



Option Strict On

' For thread http://ift.tt/1zBjkVd

Public Class Form1

Declare Function SendMessage Lib "user32.dll" Alias "SendMessageW" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr

Dim WM_VSCROLL As Integer = &H115

Private Const SB_LINEUP As Integer = &H0
Private Const SB_LINEDOWN As Integer = &H1
Private Const SB_PAGEUP As Integer = &H2
Private Const SB_PAGEDOWN As Integer = &H3
Private Const SB_TOP As Integer = &H6
Private Const SB_BOTTOM As Integer = &H7
Private Const SB_ENDSCROLL As Integer = &H8

Declare Function SendMessage Lib "user32.dll" Alias "SendMessageW" (ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As Integer, ByRef lParam As Point) As Integer

Const WM_USER As Integer = &H400
Const EM_GETSCROLLPOS As Integer = WM_USER + 221
Const EM_SETSCROLLPOS As Integer = WM_USER + 222

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

Me.CenterToScreen()
Me.BackColor = Color.AliceBlue

RichTextBox1.BackColor = Color.Silver
RichTextBox1.ForeColor = Color.White
RichTextBox1.Font = New Font("Cambria", 12)
RichTextBox1.ScrollBars = RichTextBoxScrollBars.ForcedHorizontal
RichTextBox1.Anchor = CType(AnchorStyles.Left + AnchorStyles.Top + AnchorStyles.Bottom, AnchorStyles)
RichTextBox1.WordWrap = False
RichTextBox1.ReadOnly = True
RichTextBox1.TabStop = False

RichTextBox2.Font = New Font("Cambria", 12)
RichTextBox2.ScrollBars = RichTextBoxScrollBars.ForcedHorizontal
RichTextBox2.Anchor = CType(AnchorStyles.Left + AnchorStyles.Top + AnchorStyles.Right + AnchorStyles.Bottom, AnchorStyles)
RichTextBox2.WordWrap = False
RichTextBox2.ReadOnly = False
RichTextBox2.TabStop = True

VScrollBar1.Value = 0
VScrollBar1.Maximum = 100
VScrollBar1.Anchor = CType(AnchorStyles.Top + AnchorStyles.Right + AnchorStyles.Bottom, AnchorStyles)

Label1.BackColor = Color.SlateGray
Label1.ForeColor = Color.Aqua
Label1.Font = New Font("Book Antiqua", 14)
Label1.Text = "Waiting"
Label1.Left = CInt(RichTextBox2.Left + (RichTextBox2.Width / 2) - (Label1.Width / 2))

End Sub

Private Sub Form1_Resize(sender As Object, e As EventArgs) Handles Me.Resize
Label1.Left = CInt(RichTextBox2.Left + (RichTextBox2.Width / 2) - (Label1.Width / 2))
End Sub

Private Sub RichTextBox2_TextChanged(sender As Object, e As EventArgs) Handles RichTextBox2.TextChanged
If RichTextBox2.Text <> "" Then
RichTextBox1.Clear()
Dim Temp As String = ""
For i = 0 To RichTextBox2.Lines.Count - 1
Temp &= (i + 1).ToString & ". = " & RichTextBox2.Lines(i).Length.ToString & vbCrLf
Next
Temp = Temp.Remove(Temp.Count - 2, 2)
RichTextBox1.Text = Temp
VScrollBar1.Maximum = RichTextBox2.Lines.Count
VScrollBar1.Value = RichTextBox2.GetLineFromCharIndex(RichTextBox2.SelectionStart)
Label1.Text = "RTB2 Line Nr = " & (RichTextBox2.GetLineFromCharIndex(RichTextBox2.SelectionStart) + 1).ToString & ", Length = " & RichTextBox2.Lines(RichTextBox2.GetLineFromCharIndex(RichTextBox2.SelectionStart)).Length.ToString & "."
Label1.Left = CInt(RichTextBox2.Left + (RichTextBox2.Width / 2) - (Label1.Width / 2))
Dim RTB2SP As Point
SendMessage(RichTextBox2.Handle, EM_GETSCROLLPOS, 0, RTB2SP)
SendMessage(RichTextBox1.Handle, EM_SETSCROLLPOS, 0, RTB2SP)
Else
RichTextBox1.Clear()
End If
End Sub

Private Sub RichTextBox2_KeyUp(sender As Object, e As KeyEventArgs) Handles RichTextBox2.KeyUp
Dim RTB2SP As Point
SendMessage(RichTextBox2.Handle, EM_GETSCROLLPOS, 0, RTB2SP)
SendMessage(RichTextBox1.Handle, EM_SETSCROLLPOS, 0, RTB2SP)
VScrollBar1.Value = RichTextBox2.GetLineFromCharIndex(RichTextBox2.SelectionStart)
If RichTextBox2.Text <> "" Then
Label1.Text = "RTB2 Line Nr = " & (RichTextBox2.GetLineFromCharIndex(RichTextBox2.SelectionStart) + 1).ToString & ", Length = " & RichTextBox2.Lines(RichTextBox2.GetLineFromCharIndex(RichTextBox2.SelectionStart)).Length.ToString & "."
Label1.Left = CInt(RichTextBox2.Left + (RichTextBox2.Width / 2) - (Label1.Width / 2))
End If
End Sub

Private Sub RichTextBox2_MouseMove(sender As Object, e As MouseEventArgs) Handles RichTextBox2.MouseMove
Dim RTB2SP As Point
SendMessage(RichTextBox2.Handle, EM_GETSCROLLPOS, 0, RTB2SP)
SendMessage(RichTextBox1.Handle, EM_SETSCROLLPOS, 0, RTB2SP)
If RichTextBox2.Text <> "" Then
Label1.Text = "RTB2 Line Nr = " & (RichTextBox2.GetLineFromCharIndex(RichTextBox2.SelectionStart) + 1).ToString & ", Length = " & RichTextBox2.Lines(RichTextBox2.GetLineFromCharIndex(RichTextBox2.SelectionStart)).Length.ToString & "."
Label1.Left = CInt(RichTextBox2.Left + (RichTextBox2.Width / 2) - (Label1.Width / 2))
End If
End Sub

Dim VScrollFirst As Integer = 0
Dim VScrollSecond As Integer = 0

Private Sub VScrollBar1_Scroll(sender As Object, e As ScrollEventArgs) Handles VScrollBar1.Scroll
If RichTextBox1.Lines.Count > 0 Then
VScrollFirst = VScrollBar1.Value
If VScrollFirst > VScrollSecond Then
For i = 1 To VScrollFirst - VScrollSecond
SendMessage(RichTextBox1.Handle, WM_VSCROLL, CType(SB_LINEDOWN, IntPtr), IntPtr.Zero) ' Scrolls down
SendMessage(RichTextBox2.Handle, WM_VSCROLL, CType(SB_LINEDOWN, IntPtr), IntPtr.Zero) ' Scrolls down
Next
ElseIf VScrollFirst < VScrollSecond Then
For i = 1 To VScrollSecond - VScrollFirst
SendMessage(RichTextBox1.Handle, WM_VSCROLL, CType(SB_LINEUP, IntPtr), IntPtr.Zero) ' Scrolls up
SendMessage(RichTextBox2.Handle, WM_VSCROLL, CType(SB_LINEUP, IntPtr), IntPtr.Zero) ' Scrolls up
Next
End If
VScrollSecond = VScrollBar1.Value
End If
End Sub

End Class





La vida loca


Visual Basic 2010 line counter




La vida loca


When output SSRS report to Excel, Plus sign was moved to the far left pane in Excel. How to fix it?

Hi cat_ca,


Microsoft Excel has limitations with how it manages hidden and displayed report items when they are exported. When we export a report to Microsoft Excel format, groups, rows, and columns that contain report items that can be toggled are rendered as Excel outlines. Excel creates outlines that expand and collapse rows and columns across the entire row or column which can cause the collapse of report items that are not intended to be collapsed. This is by design. For more information about this, please see Show and Hide section in the link below:

http://ift.tt/1uMWXx3


The following similar thread is for your reference:

http://ift.tt/1lhxNgt


Thank you for your understanding.


Regards,

Katherine Xiong




Katherine Xiong

TechNet Community Support




How we can manage SharePoint data if we have thousands and thousands of files in a Library

Should we archive the data. If yes? How?


Can we create hierarchy?


It is the case if we have thousands and thousands of files in our SharePoint.


Also what would be the best way to query the data in this case?


Thanks


Iterate through results set to construct XML file

Just a personal opinion, but I would seriously be looking at XML serialization to format XML output: http://ift.tt/1o5q0pr


It would be greatly appreciated if you would mark any helpful entries as helpful and if the entry answers your question, please mark it with the Answer link.


How to optimize string allocation?

Here is the code...



private char[] buffer = new char[32];

internal string ExtractString(int len)
{
if (len > buffer.Length)
{
// the buffer is too small, make it bigger
Array.Resize(ref buffer, buffer.Length * 2);
}

for (int i = 0; i < len; i++)
buffer[i] = (char)_data[_currentIndex++];

return new string(buffer, 0, len);
}

The profiler shows that the hot spot of this method is "new string(buffer, 0, len)". Anyway to optimize this?


I am thinking to keep the result string in Dictionary and then searching buffer[] in Dictionary to not allocate the string again if it does exist in the Dictionary. Would this help improve the performance? but I am not sure how to search buffer[] in Dictionary with vary length, any example?




atanai


Setting Clockcreen = applications on windows 8.1.

Code Setting Clockscreen images= applications on window 8.1.


ex: i have 3 picture on listbox and choosen it then changed clock screen.Don't give me link msn..


im bad english.


Load and reading file pdf, txt...??????????????????

Load and reading file pdf, txt...on windows phone 8.1 ??????????????????

SSRS 2012: change action of reportbuilder button?

Hi,


Is it possible to start a locally installed Report Builder when I hit the Report Builder button in SSRS? It now want to download reportbuilder... and it is already installed. (Using SSRS 2012 SP1)






SSRS 2012: change action of reportbuilder button?

Hi HansAnderss,


Report Builder is available in two versions: stand-alone and ClickOnce. The stand-alone version is installed on your computer by you or an administrator. The ClickOnce version is installed automatically with SQL Server 2012 Reporting Services (SSRS) and downloaded to your computer from Report Manager or a SharePoint site integrated with Reporting Services.


The Report Builder button on Report Manager is used to start ClickOnce version of Report Builder. We can change the default ClickOnce application to other ClickOnce version of Report Builder application in Report Manager, but cannot change it to stand-alone version. If we want to start Report Builder stand-alone (locally) version, we can click All Programs on the Start menu, and then click Microsoft SQL Server 2012 Report Builder.


References:

Change the default ClickOnce application in Report Manager

Start Report Builder (Report Builder)


Hope this helps.


Thanks,

Katherine Xiong




Katherine Xiong

TechNet Community Support



SSRS 2012: change action of reportbuilder button?

Thanks Katherine! Can we hide that button to prevent any confusion?

SSRS 2012: change action of reportbuilder button?

Hi HansAnderss,


If you want to hide Report Builder button for all users, we can refer to the following steps to achieve this goal:



  1. Connect to reporting services server and open Reporting Services Configuration Manager.

  2. Go to database setup and note Database Server name and database name.

  3. Open SQL Server Management Studio and connect to the database server from previous step.

  4. Expand database node then expand tables, right click ConfigurationInfo table to select “Edit Top 200 Rows”.

  5. Then make the value of “EnableReportDesignClientDownload” to “False” to disable Report Builder button.




If you want to hide Report Builder button for some particular users, we can refer to the following steps to achieve this goal:



  1. Open SQL Server Management Studio to Reporting Services, expand the Security node and System Roles.

  2. Under the System Roles folder, right-click System Administrator and System User to uncheck "Execute Report Definitions" task. Or custom a system role do not contain the "Execute Report Definitions" task. The users assign in these roles will not be able to see the report builder button.


If there are any other questions, please feel free to ask.


Thanks,

Katherine Xiong




Katherine Xiong

TechNet Community Support



Lightswitch Issue - Only Using Admin account Express DB can be started

Hi,


As this question is more relate to Lightswitch, I suggest you post it to Visual Studio LightSwitch Forum, you will get more help and confirmed answers from there.


http://ift.tt/13uWnGe


Best regards




Dennis Guo

TechNet Community Support



Error with OneNote sync

Hi,


According to your description, my understanding is that the error occurred when syncing OneNote to SharePoint document library.


Based on the error message, the issue is due to the network. However, other sections in this notebook can be synced.


I recommend to check the ULS log for more detailer error message.


For SharePoint 2010, by default, ULS log is at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS.


You can check the ULS log by the methods here:


http://ift.tt/1blMGN2


http://ift.tt/1kBzIgN


Best regards.


Thanks


Victoria Xia

TechNet Community Support



which app is better to work on with?

I sont think you can say it that easy. depend on scenario and requirements


Microsoft Certified Solutions Developer - Windows Store Apps Using C#


which app is better to work on with?

The kind of app depends on factors such as functionality and the size of the user base you desire. You might want to build a Desktop App if...

-the app has a lot of features/functionality the User can call upon (does "a lot" of things)

-the app is used to develop "documents" or complex projects for work

-you want a single app available to a lot of PC users (i.e., available on Windows 7 as well as Windows 8.1)



You would want a Mobile App if...

-All the necessary functionality can be implemented in a simple interface (does "a few" things)

-You want an easy hub for maintaining the app, hearing user feedback, and making a profit (Windows Store)

-You might find that developing a mobile app is easier than a desktop application (I did, though I wouldn't call it easy)



There are advantages and disadvantages to either one and you have to weigh them out. A Desktop app will be usable on most computers, but how many people will encounter your application (and how many will install it)? A Mobile app is available to fewer people, but those people are slightly more likely to see your app and trust it.



There is no right answer. I'm just offering guidelines, not rules, and you are free to disagree with me.

Cross domain using Jquery

Hi,


According to your post, my understanding is that you want to call SharePoint cross domain using jQuery AJAX.


Here are two blogs for your reference:


Cross Domain AJAX Request Using JQuery

http://ift.tt/1rORoZg


Making Cross Domain jQuery AJAX Calls

http://ift.tt/Xmc2Xu


Best Regards




Dennis Guo

TechNet Community Support



Is it possible to show a webpart only in a specific subfolder page?

Can someone atleast tell me or it is possible?


Wednesday, July 30, 2014

How to start an sp_procoption "STARTUP" enabled Stored Procedure without restarting SQL Server?

So could you explain what you are doing with STARTUP option and what that has to do with a killing a session.


May be what you need is a logon trigger ?


Logon Triggers




Satheesh

My Blog | How to ask questions in technical forum





Flipview Image Viewer

Hello,


I have a flipview that holds images that I have taken from my webcam. What I want to do is allow users to click on the image and view it in an enlarged view.


So far I have some code for an image viewer and for a pointer pressed method that I would place on the page where I take the image but I feel like I am doing too much work. Is there a way to to do this by just having a method to capture the click event and open a popup control of the enlarged image?


Any help on how to do this would be greatly appreciated.


Thank you


Flipview Image Viewer

Put your image in a button and handle the button click event. This will automatically include keyboard focus support as well.


You can modify the button template to remove borders and such.


Flipview Image Viewer

Hi Rob,


Since the images are in a flipview I started to add a pointer pressed method so that when the user clicks the image it will fire an event. But I would like to open a popup as opposed to my method which was a user control. I think its a lot more work than needed just to view an enlarged view of an image.


Any solution as to how to go about it that way instead of a button? I can provide current code if needed.


Flipview Image Viewer

Hi Rob,


I was able to get a popup to display the image instead but it is not centering like it is supposed to. I have the following method to center all my popup controls and it has worked previously but has not worked on this popup:



private void CenterPopup(Popup popup, bool autoHeight)
{
popup.IsOpen = true;
FrameworkElement child = popup.Child as FrameworkElement;

child.Width = Window.Current.Bounds.Width - 200;
popup.HorizontalOffset = 100;
child.UpdateLayout();

if(autoHeight)
{
popup.VerticalOffset = (Window.Current.Bounds.Height - child.ActualHeight) /2;
}
else
{
child.Height = Window.Current.Bounds.Height - 100;
child.MaxWidth = child.Width;
popup.VerticalOffset = 50;
}
}

And when centering the item in the Tapped event for the image I just say: CenterPopup(imageWindow, true); and it is perfectly centered.


But for this popup it seems to center on the page horizontally but not vertically. So it just is centered and is at the bottom of the frame. Any advice on how to fix this problem?


Send data from user input to XML

Hi Matt,


I was able to get it to partially work by doing the following for example:



private string _userNotes;

public string UserNotes
{
string email = UserInformation.GetDisplayNameAsync(); //Get user email address
get{ return "" + "Test Info" + "Test Test Test" + email + _userNotes; }

set{ _userNotes = value; }
}

The problem I get is that whatever user information I get does not show up. Instead I get SystemObject.... error when it runs. Also everytime I run the app there seems to be a loop or something cause the information to repeat. So instead of one instance of the return string displaying in the textbox everytime I run another return string is added to the top of the previous and so on...


Any ideas on how to fix those?


How do I create and run an asynchronus method on two different thread?

Hi Lucas,



My observation is you are looking for a way of parallelizing, if that's the case below might help you.




static void SomeProcess()
{
Thread.Sleep(3000); // Do CPU work here.
}

static async Task Test()
{
// Start two background operations.
Task task1 = Task.Run(SomeProcess);
Task task2 = Task.Run(SomeProcess);

// Wait for them both to complete.
await Task.WhenAll(task1, task2);
}






How to quote a forward slash in a WebClient connect string?

Try this



http://ift.tt/1nVlwnM
http://ift.tt/1rJsdrc





jdweng


How to quote a forward slash in a WebClient connect string?

Hi no, it must be as follows:


http://ift.tt/1nVltZa; + userID + "&api=" + APIKey + "&email=" + email + "&password=" + password )


where the userID is 9k2/vo1dsk


The problem is the forward slash in the userID string.


How to quote a forward slash in a WebClient connect string?

I guess you have tried to urlencode it, might work depending on server configuration?


userID=9k2%2Fvo1dsk


How to quote a forward slash in a WebClient connect string?

Hi are you suggesting this for readability or that using the parameters will ensure that the proper encoding is done?


I tried using urlEncode in the System.Web class and it made no difference.


Still not successful.


How do I create and run an asynchronus method on two different thread?

Hi All,


I wanted to create an asynchronus method which further I want to run on two differnt threads.


Is it possible ? if yes then please share the steps to do it.


Thanks and Regards,


Lucas


How do I create and run an asynchronus method on two different thread?

Hi Lucas,


You can also ThreadPool.QueueUserWorkItem Method (WaitCallback),The method executes when a thread pool thread becomes available.



using System;
using System.Threading;
public class Example {
public static void Main() {
// Queue the task.
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc));

Console.WriteLine("Main thread does some work, then sleeps.");
// If you comment out the Sleep, the main thread exits before
// the thread pool task runs. The thread pool uses background
// threads, which do not keep the application running. (This
// is a simple example of a race condition.)
Thread.Sleep(1000);

Console.WriteLine("Main thread exits.");
}

// This thread procedure performs the task.
static void ThreadProc(Object stateInfo) {
// No state object was passed to QueueUserWorkItem, so
// stateInfo is null.
Console.WriteLine("Hello from the thread pool.");
}
}



Have a nice day!


Kristin


Help in query for errors

Hi, I have run the following script but only columns name is showing in the result. I also want to show the rows if possible. Please help.



USE tempdb

create table travel (tr_id numeric, tr_site char(14), tr_city char(10))
insert into travel values (1,'STY_YTRY','Markham')
insert into travel values (2,'STY_YTRY_DT','Dehli')
insert into travel values (3,'STY_YTRY','NewYork')
insert into travel values (4,'STY_YTRY_HT','Emsterdam')
insert into travel values (5,'STY_YTRY','Toronto')
insert into travel values (6,'STY_YTRY','Markham')

create table travel_2 (tr_id numeric, tr_site char(10), tr_city char(8))


declare @Stablename varchar(400) = 'travel',@Dtablename varchar(400) = 'travel_2'
declare @sql varchar(max)=' Print ''Columns that has data greater that max_length are:'''+char(13)

select @sql =@sql + 'If Exists (select top 1 '+a.name+' from '+@Stablename+' where datalength('+a.name+') > '+convert(varchar,a.max_length)+') Print '''+a.name+'''' +char(13) from sys.columns a inner join sys.types b
on a.user_type_id = b.user_type_id
where object_id=object_id(@Dtablename) and b.name like '%char%'
--print @sql
Exec (@sql)
--Results from this script
Columns that has data greater that max_length are:
tr_site
tr_city

--Desired output as mentioned above
tr_site
------
STY_YTRY_DT
STY_YTRY_HT

tr_city
------
Emsterdam


Help in query for errors

Hi, I have run the following script but only columns name is showing in the result. I also want to show the rows if possible. Please help.



USE tempdb

create table travel (tr_id numeric, tr_site char(14), tr_city char(10))
insert into travel values (1,'STY_YTRY','Markham')
insert into travel values (2,'STY_YTRY_DT','Dehli')
insert into travel values (3,'STY_YTRY','NewYork')
insert into travel values (4,'STY_YTRY_HT','Emsterdam')
insert into travel values (5,'STY_YTRY','Toronto')
insert into travel values (6,'STY_YTRY','Markham')

create table travel_2 (tr_id numeric, tr_site char(10), tr_city char(8))


declare @Stablename varchar(400) = 'travel',@Dtablename varchar(400) = 'travel_2'
declare @sql varchar(max)=' Print ''Columns that has data greater that max_length are:'''+char(13)

select @sql =@sql + 'If Exists (select top 1 '+a.name+' from '+@Stablename+' where datalength('+a.name+') > '+convert(varchar,a.max_length)+') Print '''+a.name+'''' +char(13) from sys.columns a inner join sys.types b
on a.user_type_id = b.user_type_id
where object_id=object_id(@Dtablename) and b.name like '%char%'
--print @sql
Exec (@sql)
--Results from this script
Columns that has data greater that max_length are:
tr_site
tr_city

--Desired output as mentioned above
tr_site
------
STY_YTRY_DT
STY_YTRY_HT

tr_city
------
Emsterdam



Try below



USE tempdb
--drop table travel,travel_2

create table travel (tr_id numeric, tr_site char(14), tr_city char(10))
insert into travel values (1,'STY_YTRY','Markham')
insert into travel values (2,'STY_YTRY_DT','Dehli')
insert into travel values (3,'STY_YTRY','NewYork')
insert into travel values (4,'STY_YTRY_HT','Emsterdam')
insert into travel values (5,'STY_YTRY','Toronto')
insert into travel values (6,'STY_YTRY','Markham')

create table travel_2 (tr_id numeric, tr_site char(10), tr_city char(8))



declare @Stablename varchar(400) ,@Dtablename varchar(400)
set @Stablename = 'travel'
set @Dtablename = 'travel_2'
declare @sql varchar(4000)=''
--set @sql =' Print ''Columns that has data greater that max_length are:'''+char(13)

select @sql =@sql + 'select distinct '+a.name+' from '+@Stablename+' where len('+a.name+') > '+convert(varchar,a.max_length)+char(13) from sys.columns a inner join sys.types b
on a.user_type_id = b.user_type_id
where object_id=object_id(@Dtablename) and b.name like '%char%'
print @sql
Exec (@sql)


How can i manage lots of Data Entry in XAML C# ?

I have a Windows C# application which captures a lot of data, probably around 30-40 pieces of info per insert, depending on what is being added to the database, this can grow or shrink.


The controls are mostly Combo boxes, and Edit boxes.


These combos/edits are grouped in group boxes, and separated in Tabs.So that the End-user has everything on the screen in front of them, and they click a tab to just go into a different section to fill out extra details...


There are no Tab Controls in a XAML Store App, so is the only solution to have 4 or 5 pages that the user navigates from a main Navigation screen with lets say 5 buttons that take them to which ever section they need to fill out at that moment?


Does anyone have a link to a good demo on how to solve presenting a user with lots of data entry controls in a store App


any help is greatly appreciated.


Loop threw string to find substring ??

I reckon best option would be using .Split() method on line string variable, so it returns a string array that contains the sub-strings delimited by comma and you can have all sub-strings before and after any comma in the instance.



var commaSplitted = line.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);


Loop threw string to find substring ??

This assumes that there won't be two or more consecutive commas in the string.

It also assumes that the string won't begin or end with a comma.



- Wayne


Loop threw string to find substring ??

I tried the code an it works, but it wouldn't give me the last number?? the patten that I am working with can be like <.ewee>2,1,4,6%deasdad


I tried messing with the count, that just gave me duplicates..??



How to implement poor-man's version control with TSQL queries

I hope your looking for this



--Create sample data

CREATE TABLE Projects
([Project] varchar(1), [Version] int)
;

INSERT INTO Projects
([Project], [Version])
VALUES
('A', 1),
('A', 2),
('A', 3),
('A', 4),
('B', 1),
('B', 2),
('B', 3),
('C', 1),
('C', 2),
('D', 1)
;


WITH CTE AS(
SELECT *, Row_Number()OVER(Partition by Project Order by version desc) ROWNUM
FROM Projects)
SELECT * FROM CTE WHERE ROWNUM=1





Satheesh

My Blog | How to ask questions in technical forum



Anyone know how to use AODL from the nuget library?

You'll be best of talking to the owner or checking the forums for that project. If you follow the links from the project you'll get to an active forum.


Also double check that project supported Windows Store apps. It looked like the sort that will have invalid file access if it isn't written specifically for Universal apps


Anyone know how to use AODL from the nuget library?

Not something I'm familiar with, sorry.


Check the forum links again. You have to make a few jumps but they did lead to an active forum. I'm on my phone so I can't track down the link for you.


How can i manage lots of Data Entry in XAML C# ?

Hi Win8Dev2014,


You can have the similar thing in Windows Store App, there is no tab, but spilt page looks like a tab (C#, VB, and C++ project templates).


But basically you may need put your data into a data pool which act as data resource. Use Linq to group the data into groups and binding the group data to the control should be a good option. See more information: How to create a master-details binding



--James




<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>

Thanks

MSDN Community Support



Please remember to "Mark as Answer" 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.


Anyone know how to use AODL from the nuget library?

You'll be best of talking to the owner or checking the forums for that project. If you follow the links from the project you'll get to an active forum.


Also double check that project supported Windows Store apps. It looked like the sort that will have invalid file access if it isn't written specifically for Universal apps


ListView Oddity - Windows Store App

Hi MilelAk,


the link you've provided is no more available.




Thomas Claudius Huber



"If you can't make your app run faster, make it at least look & feel extremly fast"



My latest Pluralsight-course: Windows Store Apps - Data Binding in Depth



twitter: @thomasclaudiush

homepage: http://ift.tt/1fArvuE

author of: ultimate Windows Store Apps handbook | ultimate WPF handbook | ultimate Silverlight handbook


ListView Oddity - Windows Store App

Hi!


Can you try this one: http://goo.gl/YYrm5W


ListView Oddity - Windows Store App

Hi,


The link you provide also cannot open.


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. <br/> Click <a href="http://ift.tt/1jqjHZt; HERE</a> to participate the survey.


Simple iButton interface

Hi there.


I would really appreciate some help on iButtons as I have never dealt with them before. All the documentation I have seen is very complex and beyond what I need.


All I want to happen is when an iButton is attached - an event is triggered and the iButton's unique code is read and stored. I don't need it to do anything more complex than that.


If there is a webpage that explains this that I have missed then please let me know.


Thanks in advance for your assistance.


Simple iButton interface

Typically - I find it just after posting this question!


For anyone else needing this simple interaction with iButtons:


Grab the Software Development Kit from Maxim.


The example file is in: 1-wiresdkver400/Examples/http://ift.tt/1qpDlIH


Attach an iButton to your reader(or network) and press the search button. I can now tailor this to a much simpler use where I only have one reader and want to trigger an event when iButton is attached.


ViewBag Issue - There is no ViewData item of type 'IEnumerable ' that has the key

Hi,


ASP.NET MVC questions should be posted here:


http://ift.tt/STuz7m


I suggest you firstly check the source HTML of the page to see if the generated HTML has something wrong.




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.


Help in query for errors

Hi, I have run the following script but only columns name is showing in the result. I also want to show the rows if possible. Please help.



USE tempdb

create table travel (tr_id numeric, tr_site char(14), tr_city char(10))
insert into travel values (1,'STY_YTRY','Markham')
insert into travel values (2,'STY_YTRY_DT','Dehli')
insert into travel values (3,'STY_YTRY','NewYork')
insert into travel values (4,'STY_YTRY_HT','Emsterdam')
insert into travel values (5,'STY_YTRY','Toronto')
insert into travel values (6,'STY_YTRY','Markham')

create table travel_2 (tr_id numeric, tr_site char(10), tr_city char(8))


declare @Stablename varchar(400) = 'travel',@Dtablename varchar(400) = 'travel_2'
declare @sql varchar(max)=' Print ''Columns that has data greater that max_length are:'''+char(13)

select @sql =@sql + 'If Exists (select top 1 '+a.name+' from '+@Stablename+' where datalength('+a.name+') > '+convert(varchar,a.max_length)+') Print '''+a.name+'''' +char(13) from sys.columns a inner join sys.types b
on a.user_type_id = b.user_type_id
where object_id=object_id(@Dtablename) and b.name like '%char%'
--print @sql
Exec (@sql)
--Results from this script
Columns that has data greater that max_length are:
tr_site
tr_city

--Desired output as mentioned above
tr_site
------
STY_YTRY_DT
STY_YTRY_HT

tr_city
------
Emsterdam


C# TCP Socket Server with Windows RT

I have been searching quite while and I cannot seem to be able to find an answer to this simple question. Is there any way to create a TCP server in a Windows RT (Win / WP 8.1) C# application?


PS. This will ultimately be used in the development of an HTML compatible WebSocket server.


C# TCP Socket Server with Windows RT

Cannot get coordinates of tapped area

Please try it with:



PointerPoint pt = e.GetCurrentPoint(grid );



Btw: Why don't you use a Canvas instead of a Grid for that senario?




Thomas Claudius Huber



"If you can't make your app run faster, make it at least look & feel extremly fast"



My latest Pluralsight-course: Windows Store Apps - Data Binding in Depth



twitter: @thomasclaudiush

homepage: http://ift.tt/1fArvuE

author of: ultimate Windows Store Apps handbook | ultimate WPF handbook | ultimate Silverlight handbook


Cannot get coordinates of tapped area

yeah I even tried that by putting grid at place of null.....yet same scenario


Canvas is working though...But i wish to know the reason


Cannot get coordinates of tapped area

Hi,


I think this ia because the difference between Grid and Canvas.A Canvas is absolute - the content (children) won't size to fit and always appear where you specify them, relative to the Canvas upper left corner.



Whereas the grid can size to fit the children, a canvas does not.


You can refer to the discussion:


http://ift.tt/1nKZR0z


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. <br/> Click <a href="http://ift.tt/1jqjHZt; HERE</a> to participate the survey.


ReportServer Process sleeping with an open transaction

ReadChunkSegment, WriteLockSession, CreateChunkSession all are sleeping with an open transaction?


That usually tells me that someone didn't clean-up their transaction. Is that normal for reporting services?


ReportServer Process sleeping with an open transaction

What DBCC OPENTRAN returns?


Best Regards,Uri Dimant SQL Server MVP, http://ift.tt/1iQ9JkR



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


Display image with reportviewer from ftp

If possible could you help upload your project to OneDrive? Try to simplify your program, As it is clear to see where the issue occurs.


Thanks


How to implement poor-man's version control with TSQL queries

I have a table called Project. Each row completely describes a project and has a username, project name, project description and other numeric parameters that contain all the data about the project.


When multiple rows have the same username, this means a user owns multiple projects.


Now I want to implement a poor-man's version control for my users by adding a new integer column called version. When a user wants to save a new version of his project, the version is incremented and a new row is inserted into the table.


Some projects will have 1 version, others will have a dozen or more.


By default, the user should see a data grid of projects where only the latest version of the project is displayed (including the version count) and all the older versions of each project are ignored.


How do I write a TSQL query to populate this data grid (and ignore every version except the latest versions of each project)?


Thanks


Siegfried




siegfried heintze


Auto scroll the Flipview inside of HubSection in windows store app

I am trying to auto flip the item of FlipView Items in windows store app. I have tried the following code.



public MainPage()
{
InitializeComponent();

//Configure the timer
_timer
= new DispatcherTimer
{
//Set the interval between ticks (in this case 2 seconds to see it working)
Interval = TimeSpan.FromSeconds(2)
};

//Change what's displayed when the timer ticks
_timer
.Tick += ChangeImage;
//Start the timer
_timer
.Start();
}

/// <summary>
/// Changes the image when the timer ticks
/// </summary>
/// <param name="sender"></param>
/// <param name="o"></param>
private void ChangeImage(object sender, object o)
{
//Get the number of items in the flip view
var totalItems = TheFlipView.Items.Count;
//Figure out the new item's index (the current index plus one, if the next item would be out of range, go back to zero)
var newItemIndex = (TheFlipView.SelectedIndex + 1) % totalItems;
//Set the displayed item's index on the flip view
TheFlipView.SelectedIndex = newItemIndex;
}


But i am not able to access the FlipView from .cs file because of the FlipView defined inside of HubSection. How can i solve this? Is there any way of accessing the FlipView or any other way of auto flip the item of FlipView.




Sumit Tuladhar


Auto scroll the Flipview inside of HubSection in windows store app

SSRS 05 snapshot with dynamic date parameter

I want to use snapshot for a SSRS 05 report due to high volume of report data. This report uses 2 date parameter which will keep changing every month ( mmyyyy) format. I read many blogs but it seems I can not have snapshot report in dynamic date situation.


Can someone please suggest if there is any workaround to use snapshot with dynamic date parameter . The report server version is 2005.




Gaur


Lightswitch Issue - Only Using Admin account Express DB can be started

I have created a Lightswitch application that provides quick UI for master tables in SQL DB. Lightswitch deployment created a local SQL Express database as per the deployment. I had lots of trouble making deployment successful. During deployment I have added myself as Lightswitch Admin.


Finally I added my collegues as well in Admin role using Security Module provided within UI.


Now my problem is whenever app pool is recycled, I must login to server using my account and access the application which it seems starts this local DB within SQL Epxress. Only after that other users can access this app remotely.


What is missing? I dont want this dependency on me and would like to have app always available irresepective of who accesses it first after recyle.




Prasad