Thursday, October 31, 2013

Can't create a mailitem under outlook2010 and win8

Hi, all



Microsoft.Office.Interop.Outlook.MailItem olkMail1 =
(olkApp1.CreateItem(Outlook.OlItemType.olMailItem)) as Outlook.MailItem;
olkMail1.To = @"dd";
olkMail1.CC = "";
olkMail1.Subject = "Assignment note";
olkMail1.Body = "Assignment note";

//Automate the Outlook mail item.
Outlook.Accounts accounts = olkApp1.Session.Accounts;
foreach (Outlook.Account temp in accounts)
{
if (temp.SmtpAddress == "frank@hello.com")
MessageBox.Show("hello");
}



In this code block, the createitem method always return null, after google, some users say it might be the user access control(UAC) problem. Is there any way to solve this problem by code instead of change UAC?






Every answer may help a lot, thanks guys

Frank


how to call multiple actions in single view in mvc3

The MVC forum is at http://forums.asp.net/1146.aspx


Paul Linton


Stored procedure fails during execution with a syntax error

What is the database maintenance plan?


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



Stored procedure fails during execution with a syntax error

Hi Byron,


Based on the error message, I think the issue may occur if we pass some invalid parameter with “BEGI”. I suggest adding some filter to the stored procedure to make sure that the input parameter is valid. Additionally, please post your stored procedure script here for analysis.


Best Regards,

Allen Li




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.


Local temporary table vs table variable - SQL Server 2008 R2/2012

Hi,


looking inside an old stored procedure I've seen the definition of a local temporary table as SELECT ... INTO #tmptable.


In this case, and more in general, could it be better to use a table variable, also the performance of the stored procedure?


Thanks


Local temporary table vs table variable - SQL Server 2008 R2/2012

As far as i know,if you have large amounts of data,so temp table can be good option,cause you can create index on temporary table.


Local temporary table vs table variable - SQL Server 2008 R2/2012

Local temporary table vs table variable - SQL Server 2008 R2/2012


could it be better to use a table variable, also the performance of the stored procedure?



Local/global temporary table do have an advantage: You can create an index on them, so sometime a temp table is the better option.


But for small amount of data a table variable is easier to handle.




Olaf Helper


[ Blog] [ Xing] [ MVP]

Local temporary table vs table variable - SQL Server 2008 R2/2012

Yet another link which details the difference.


http://sqlserverplanet.com/tsql/yet-another-temp-tables-vs-table-variables-article




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


Local temporary table vs table variable - SQL Server 2008 R2/2012

Hi Uri, I think that Olaf refers the possibility to create whatever index on a temporary table.


Therefore, from the point of view of the performances temporary table and table variable are similar.


Thanks


Local temporary table vs table variable - SQL Server 2008 R2/2012




Therefore, from the point of view of the performances temporary table and table variable are similar.


Thanks



Not always. It depends on the data, and the choice of optimizer. As a case, Parallelism will not support with table variable, but qualifies the temp table. Likewise, other factors. Please read the link posted in the previous thread.


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


Local temporary table vs table variable - SQL Server 2008 R2/2012

Hi,


looking inside an old stored procedure I've seen the definition of a local temporary table as SELECT ... INTO #tmptable.


In this case, and more in general, could it be better to use a table variable, also the performance of the stored procedure?


Thanks


Local temporary table vs table variable - SQL Server 2008 R2/2012

As far as i know,if you have large amounts of data,so temp table can be good option,cause you can create index on temporary table.


Local temporary table vs table variable - SQL Server 2008 R2/2012

Local temporary table vs table variable - SQL Server 2008 R2/2012


could it be better to use a table variable, also the performance of the stored procedure?



Local/global temporary table do have an advantage: You can create an index on them, so sometime a temp table is the better option.


But for small amount of data a table variable is easier to handle.




Olaf Helper


[ Blog] [ Xing] [ MVP]

Local temporary table vs table variable - SQL Server 2008 R2/2012

Yet another link which details the difference.


http://sqlserverplanet.com/tsql/yet-another-temp-tables-vs-table-variables-article




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


Local temporary table vs table variable - SQL Server 2008 R2/2012

Hi Uri, I think that Olaf refers the possibility to create whatever index on a temporary table.


Therefore, from the point of view of the performances temporary table and table variable are similar.


Thanks


Local temporary table vs table variable - SQL Server 2008 R2/2012




Therefore, from the point of view of the performances temporary table and table variable are similar.


Thanks



Not always. It depends on the data, and the choice of optimizer. As a case, Parallelism will not support with table variable, but qualifies the temp table. Likewise, other factors. Please read the link posted in the previous thread.


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


Local temporary table vs table variable - SQL Server 2008 R2/2012


Hi,


looking inside an old stored procedure I've seen the definition of a local temporary table as SELECT ... INTO #tmptable.


In this case, and more in general, could it be better to use a table variable, also the performance of the stored procedure?


Thanks



There is not enough information about "this case" to answer your question. Temporary tables and table variables each have their own advantages and disadvantages.


It depends.


So I wouldn't change it unless you have a good reason for the change.




Gert-Jan


Local temporary table vs table variable - SQL Server 2008 R2/2012

Ok, therefore in a stored procedure that using a SELECT with more JOINs to get some millions of data I could use a temp table to insert the resulting set. Then I could have this temp table to compute a GROUP BY before to perform the final insert into a SQL table.


Or, in this scenario is it better to use a SQL table to produce the intermediate result instead of a temp table?


Thanks


Local temporary table vs table variable - SQL Server 2008 R2/2012


Ok, therefore in a stored procedure that using a SELECT with more JOINs to get some millions of data I could use a temp table to insert the resulting set. Then I could have this temp table to compute a GROUP BY before to perform the final insert into a SQL table.


Or, in this scenario is it better to use a SQL table to produce the intermediate result instead of a temp table?


Thanks



Try both approaches and chose better one.


Inserting millions of records( for the sake of group by) into a temp table itself may cost high.


So, implement both the approaches and compare and select the better one.




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


SSRS 2008 SUM Total Lines together

Hi


I had a quick read through and I can't find the answer to do what I am trying to do.


Basically I am using a matrix and I have a field that is sitting in my Total Line. (I can't sum this because of the way that the data is created...I have 6 levels of Hierarchy and these Total only apply to the top 3).


So, what I want to do Is sum up the Total lines. And Just the total Lines


e.g Total Line England = $1000


Total line Scotland = $2000


Total Lines I created $3000


Then I want to add up That total line that I created as It has a parent group that reports the Grand Total.


Hope you can help. I can't just run a straight Sum() because the data produces the same values for each row and the Total comes out as wrong (I can't change the SQL to stop this as it is a Hierarchy report).


Thank You




SSRS 2008 SUM Total Lines together

Another way of looking at this is, I have a done a countdistinct() and it has picked up 2 distinct values. How can I sum just those 2 values please?

The underlying compression routine could not reserve sufficient memory

I get this error when saving very large excel documents using DocumentFormat.OpenXml (Workbookpart.Workbook.Save()).


This was never a problem in the past with much larger Excel documents. This problem started after installing .NET 4.5.


The following is the stack trace when the error is thrown:


at System.IO.Compression.DeflaterZLib.DeflateInit(CompressionLevel compressionLevel, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy) at System.IO.Compression.DeflaterZLib..ctor(CompressionLevel compressionLevel) at System.IO.Compression.DeflateStream.CreateDeflater(Nullable`1 compressionLevel) at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionMode mode, Boolean leaveOpen) at MS.Internal.IO.Packaging.CompressStream.ChangeMode(Mode newMode) at MS.Internal.IO.Packaging.CompressStream.Write(Byte[] buffer, Int32 offset, Int32 count) at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(Byte[] buffer, Int32 offset, Int32 count) at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(Byte[] buffer, Int32 offset, Int32 count) at MS.Internal.IO.Packaging.IgnoreFlushAndCloseStream.Write(Byte[] buf, Int32 offset, Int32 count) at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) at System.IO.StreamWriter.Dispose(Boolean disposing) at System.IO.StreamWriter.Close() at System.Xml.XmlTextWriter.Close() at System.Xml.XmlWriter.Dispose(Boolean disposing) at System.Xml.XmlWriter.Dispose() at MS.Internal.IO.Packaging.InternalRelationshipCollection.WriteRelationshipPart(PackagePart part) at MS.Internal.IO.Packaging.InternalRelationshipCollection.Flush() at System.IO.Packaging.PackagePart.FlushRelationships() at System.IO.Packaging.PackagePart.CloseRelationships() at System.IO.Packaging.Package.DoCloseRelationshipsXml(PackagePart p) at System.IO.Packaging.Package.DoOperationOnEachPart(PartOperation operation) at System.IO.Packaging.Package.System.IDisposable.Dispose() at System.IO.Packaging.Package.Close() at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose(Boolean disposing) at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose() at SEToolkit.Reports.Plugins.ReportsPlugin.Controllers.ExcelControllers.ComputersExcellController.createNewComputersExcel(String fileName, List`1 epm)


Any ideas? I cannot make the documents smaller and I don't want to use interop. Office should not be installed on the machines generating these reports.


Thanks


The underlying compression routine could not reserve sufficient memory

Hi,


Please refer following link for compatibility issues with .net framework 4.5.


http://msdn.microsoft.com/en-us/library/hh367887%28v=vs.110%29.aspx


Kerberos token for a given spn

I am using the code below to get a Kerberos token to be later injected into a SAML assertion.

what I get back is a GSS wrapped Kerberos ticket, but what I need is an MIT File Credential Cache Kerberos ticket.


I haven't found an alternate way to retrieve a Kerberos token given a specific spn and user credentials. 99% ot the articles are about consuming one or using it as a WS ( not applicable to my case )


Any help or pointers are greatly appreciated



KerberosSecurityTokenProvider k1 = new KerberosSecurityTokenProvider(spn, System.Security.Principal.TokenImpersonationLevel.Impersonation, new System.Net.NetworkCredential(userName, password, domain));

KerberosRequestorSecurityToken T1 = k1.GetToken(TimeSpan.FromMinutes(1)) as KerberosRequestorSecurityToken;

sret = Convert.ToBase64String(T1.GetRequest());







Last update database SQlite

For questions specifically about SQLite you'll need to ask on a SQLite forum. I suspect there's a way to query the time of a write, but if not then you can update the table with the current time whenever you touch the DB.


--Rob


Last update database SQlite

Hi Aurelien Mota,


Welcome here!


If you want to be notified when the database is changed, maybe you need a


Data Change Notification Callbacks function


I hope it is helpful!


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.

Click HERE to participate the survey.


SSRS 2008 R2 - Multiple Value Selection Parameter - refer a dataset field for default value - how to make "Select All" as default ?

Hi Venkat,


If I understand correctly, you want to make “Select All” as default value for a Multiple Parameter which get available value from a DataSet field in Reporting Services. In this scenario, we can also set the Multiple Parameter get default values from the Dataset field.


In order to achieve your requirement, we can refer to the following steps:



  1. Right-click the parameter to open the Properties dialog box.

  2. In the left pane, click Default Values.

  3. Select Get values from a query, and set the same values as Available Values.


The following screenshot is for your reference:



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


Thanks,

Katherine Xiong




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.


SSRS 2008 R2 - Multiple Value Selection Parameter - refer a dataset field for default value - how to make "Select All" as default ?

Hi Venkat,


Sorry for the delay in getting back to you.


In Reporting Service, the method above is the simplest and most effective way to make “Select All” as default value for a multiple parameter. If it doesn’t work well in your environment, could you please tell us the reason why it doesn’t work, so that we can make further analysis.


Thanks,

Katherine Xiong




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.


Can we change or customize the Report Server Access Denied message for a report?

Hi Tina,


From your description, you want to customize the report access denied message. In Reporting Services, this feature of having custom error page doesn’t exist since SSRS 2008 (because it's no more depends on IIS but directly connects to HTTP.sys). So we can’t customize the error message. For more detail, please refer to the similar thread below which is solved by Microsoft:

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/5f990483-71b7-42a0-9a0a-a4abfa09db67/custom-error-message-when-the-data-connection-is-failed?forum=sqlreportingservices


Hope this helps.


Thanks,

Katherine Xiong




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.


How to change webpart code to point to List created under a particular site

create new SPWeb object



SPWeb sales=SPContext.Current.Site.OpenWeb("Sales")
SPList list=sales.Lists["ListName"]



the code above is given that sales site is under the root site of site colleciton




Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010


How to change webpart code to point to List created under a particular site

In addition to what Amr has mentioned, have a look at the following msdn link that will help you in understanding the structure and how to create web and list url based upon your requirement.


http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.getlist.aspx




Geetanjali Arora | My blogs |



User Profile HTML field changes length !?

Hi agc_at_nerc,


SharePoint 2010 user profiles created custom fields was defaulted to 25 characters. If you have privacy setting, it will not affected. It seems that it is design by SharePoint. You can refer to the following link.


http://www.c-sharpcorner.com/uploadfile/anavijai/create-user-profile-multivalue-properties-in-sharepoint-2010-using-powershell/


http://atriosystems.wordpress.com/2011/10/10/change-the-max-length-of-a-field-in-sharepoint-2010-user-profile/


This is also in SharePoint 2007


http://sharepointnomad.wordpress.com/2009/10/16/maximum-string-length-for-sharepoint-profile-custom-properties/


Thanks,


Jack


User Profile HTML field changes length !?

Thanks, But I'm afraid I don't see the relevance of the first two links.


The third confirms that the problem existed on 2007 but doesn't really advance our understanding of the problem.


use of PIVOT operator dynamically

Try the below:



create Table Test_30Oct1(dtDate Date,Category varchar(10),Amount money,Notes varchar(50))
Insert into Test_30Oct1 Values
('2013-01-15 00:00:00.000','Cat1',10.00,NULL),
('2013-01-16 00:00:00.000','Cat2',25.00,NULL),
('2013-02-15 00:00:00.000','Cat1',25.00,NULL),
('2013-02-17 00:00:00.000','Cat3',14.00,NULL),
('2013-03-10 00:00:00.000','Cat2',10.00,NULL),
('2013-03-02 00:00:00.000','Cat4',120.00,NULL),
('2013-04-20 00:00:00.000','Cat5',60.00,NULL),
('2013-04-29 00:00:00.000','Cat2',10.00,NULL),
('2013-05-05 00:00:00.000','Cat3',15.00,NULL),
('2013-05-21 00:00:00.000','Cat4',20.00,NULL )

DECLARE @query VARCHAR(4000)
DECLARE @Categories VARCHAR(2000)
SELECT @Categories = STUFF(( SELECT DISTINCT
'],[' + Datename(Month,dtDate) + '-' + Cast(Datepart(year,dtDate) as varchar(4))
FROM (Select distinct dtdate From Test_30Oct1) A
ORDER BY '],[' + Datename(Month,dtDate) + '-' + Cast(Datepart(year,dtDate) as varchar(4))
FOR XML PATH('') ), 1, 2, '') + ']'


SET @query = 'SELECT * FROM ( SELECT Datename(Month,dtDate) + ''-'' + Cast(Datepart(year,dtDate) as varchar(4)) dt
,amount ,Category
FROM Test_30Oct1 )t PIVOT (SUM(amount) FOR dt IN ('+@Categories+')) AS pvt'
--Print @Query
EXECUTE (@query)

Drop table Test_30Oct1






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


use of PIVOT operator dynamically

Another solution,



create table #temp(dtDate datetime,Category varchar(10),Amount decimal(10,2),Notes varchar(20))
insert into #temp values('2013-01-15 00:00:00.000','Cat1',10.00,NULL)
insert into #temp values('2013-01-16 00:00:00.000','Cat2',25.00,NULL)
insert into #temp values('2013-02-15 00:00:00.000','Cat1',25.00,NULL)
insert into #temp values('2013-02-17 00:00:00.000','Cat3',14.00,NULL)
insert into #temp values('2013-03-10 00:00:00.000','Cat2',10.00,NULL)
insert into #temp values('2013-03-02 00:00:00.000','Cat4',120.00,NULL)
insert into #temp values('2013-04-20 00:00:00.000','Cat5',60.00,NULL)
insert into #temp values('2013-04-29 00:00:00.000','Cat2',10.00,NULL)
insert into #temp values('2013-05-05 00:00:00.000','Cat3',15.00,NULL)
insert into #temp values('2013-05-21 00:00:00.000','Cat4',20.00,NULL )
-------------------
DECLARE
@cols nvarchar(max),
@stmt nvarchar(max)
SELECT @cols = isnull(@cols + ', ', '') + '[' + T.MonthYear + ']' FROM
(SELECT distinct datename(m,dtDate) + '_' + cast(year(dtDate) as varchar(4)) MonthYear from #temp) as T
SELECT @stmt = '
SELECT *
FROM (select Category, Amount,datename(m,dtDate) + ''_'' + cast(year(dtDate) as varchar(4)) MonthYear from #temp) as T
PIVOT
(
Sum(Amount) For MonthYear In (' + @cols + ')
) as P'
exec sp_executesql @stmt = @stmt





Regards, RSingh


use of PIVOT operator dynamically

Yes,


Both the queries worked well. But there are two issues with the resultset.


1. Order by should be proper like January-2013, February-2013......December-2013. Currently order is April-2013, February-2013


2. I want NULL in the resultset to be shown as zero (0)


Please help with this


use of PIVOT operator dynamically


Yes,


Both the queries worked well. But there are two issues with the resultset.


1. Order by should be proper like January-2013, February-2013......December-2013. Currently order is April-2013, February-2013


2. I want NULL in the resultset to be shown as zero (0)


Please help with this



Hi SwadPune,


Please refer to the following codes:



create table #temp(dtDate datetime,Category varchar(10),Amount decimal(10,2),Notes varchar(20))
insert into #temp values('2013-01-15 00:00:00.000','Cat1',10.00,NULL)
insert into #temp values('2013-01-16 00:00:00.000','Cat2',25.00,NULL)
insert into #temp values('2013-02-15 00:00:00.000','Cat1',25.00,NULL)
insert into #temp values('2013-02-17 00:00:00.000','Cat3',14.00,NULL)
insert into #temp values('2013-03-10 00:00:00.000','Cat2',10.00,NULL)
insert into #temp values('2013-03-02 00:00:00.000','Cat4',120.00,NULL)
insert into #temp values('2013-04-20 00:00:00.000','Cat5',60.00,NULL)
insert into #temp values('2013-04-29 00:00:00.000','Cat2',10.00,NULL)
insert into #temp values('2013-05-05 00:00:00.000','Cat3',15.00,NULL)
insert into #temp values('2013-05-21 00:00:00.000','Cat4',20.00,NULL )
-------------------
DECLARE
@cols nvarchar(max),
@stmt nvarchar(max),
@colsF nvarchar(max)

select @cols = STUFF((
SELECT ','+[MonthName]+ '_' + cast([year] as varchar(4)) from
(
select month(dtDate) [month],year(dtDate) [year],DATENAME(m,dtDate) as [MonthName]
from #temp
group by year(dtDate) ,month(dtDate),DATENAME(m,dtDate)
)as t
order by [year],[month]
for xml path('')),1,1,'')

select @colsF = STUFF((
SELECT ', case when '+[MonthName]+ '_' + cast([year] as varchar(4))+' is null then ''0'' else '+[MonthName]+ '_' + cast([year] as varchar(4)) + +' end as ' +convert(varchar(max),[MonthName]+ '_' + cast([year] as varchar(4))) from
(
select month(dtDate) [month],year(dtDate) [year],DATENAME(m,dtDate) as [MonthName]
from #temp
group by year(dtDate) ,month(dtDate),DATENAME(m,dtDate)
)as t
order by [year],[month]
for xml path('')),1,1,'')

SELECT @stmt = 'SELECT Category,'+@colsF+'
FROM (select Category, [Amount],datename(m,dtDate) + ''_'' + cast(year(dtDate) as varchar(4)) MonthYear from #temp) as T
PIVOT
(
Sum(Amount) For MonthYear In (' + @cols + ')
) as P'
exec sp_executesql @stmt = @stmt

Best Regards,

Allen Li




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.



reuse objects, data, styles

ok so I've decided to use a datatemplate and content control, this can be closed. if anyone wants a simple example let me know

VB.net Samples - Windows 8.1 App Samples - Where are they?

Seriously, why not? Has Microsoft decided to abandon VB developers? 'Stay tuned' is hardly an Answer! If these are genuinely planned please give us an ETA.


SSRS override and set thousand separator as dot on charts axis numbers

Hi,


I have a question regarding override the thousand separator on numbers shown y axis in a bar chart in a SSRS report. I have right now used the formatting: kr #,##0 and numbers are shown as kr 40 000 but my client have requested to get thousand separator as dot, kr 40.000. I have tried a lot of different settings but so far not been able to get this result. Question is now is it possible to achieve this?




Delete User Information List and re-import

For the dupes, identify the account name (domain\user) and use Move-SPUser (or stsadm -o migrateuser) to move the dupe to a valid, current account.


SharePoint - Nauplius Applications

Microsoft SharePoint Server MVP

MCITP: SharePoint Administrator 2010


Wednesday, October 30, 2013

WIX setup C# Windows8 and Registry

When you restarted did you choose the correct partition?




Paul Linton


WIX setup C# Windows8 and Registry

thanks.


Roy Wang


How to access Model sub classes in the view

Make the classes public



public class viewmodel(){
public ClassA obj1 = new ClassA();
public ClassB obj2 = new ClassB();
}

or the code below



public class viewmodel(){
public ClassA obj1 {get;set;}
public ClassB obj2 {get;set;}
public viewmodel()
{
obj1 = new ClassA();
obj2 = new ClassB();
}
}




Chnage coulmn value

Not sure of your complete data format. To the provided sample, the below would work for you.



Create Table Test_Oct_31_1(Col1 Varchar(50))
Insert into Test_Oct_31_1 Select 'PF-India-QP-9-02396'
Insert into Test_Oct_31_1 Select 'PF-India-9-0026'
Insert into Test_Oct_31_1 Select 'PF-India-QP-9-0044'

Select PARSENAME(REPLACE(REPLACE(REPLACE(Col1,'-India-QP-','I-QP-'),'-India-9-','I-STD-9-'),'-','.'),2) +'-'
+ PARSENAME(REPLACE(REPLACE(REPLACE(Col1,'-India-QP-','I-QP-'),'-India-9-','I-STD-9-'),'-','.'),4) +'-'
+ PARSENAME(REPLACE(REPLACE(REPLACE(Col1,'-India-QP-','I-QP-'),'-India-9-','I-STD-9-'),'-','.'),3) +'-'
+ PARSENAME(REPLACE(REPLACE(REPLACE(Col1,'-India-QP-','I-QP-'),'-India-9-','I-STD-9-'),'-','.'),1)
From Test_Oct_31_1

Drop table Test_Oct_31_1





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


How to fetch all separated result in Stored Procedure with While Loop

I think you should try differently like to get all your records in a single table (SET based approach rather than While or cursor based.) and use that single table to populate in application layer.


Please write your logic to use Set based approach, whcih is good for performance of your system too.




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


How to fetch all separated result in Stored Procedure with While Loop

Hello Sir Latheesh,


I made it all fetched by using .NextResult and Do While loop :



Do
While sqlReader.Read
drow("col") = sqlreader("col")
End While
Loop While Me.sqlReader.NextResult



Thank you Sir for your attention.


- Charlie



How to fetch all separated result in Stored Procedure with While Loop


Hello Sir Latheesh,


I made it all fetched by using .NextResult and Do While loop :



Do
While sqlReader.Read
drow("col") = sqlreader("col")
End While
Loop While Me.sqlReader.NextResult



Thank you Sir for your attention.


- Charlie




Its nice to see that you could do it using ONE MORE loop in application layer. But still my point exists, you will have performance issues with your approach, may be not today, but for other day (due to less number of records now). Just think of a scenario, you are returning thousands of records , you will end up with looping the records twice.


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


A weird error "Assembly(Name=mscorlib, Version=4.0.10.0" after updating to VS 2013 express.

MSCorlib Version 4 is not valid for Windows Store apps. You should be using 4.5.1 for Windows 8.1 apps or 4.5 for Windows 8 apps.


You don't provide enough information to diagnose this further: how are you building from the command line? what exactly is being built when the error occurs? what is the DLL where the problem occurs? are you building it anew here or are you just referring to it? If you're building it, how is it set up, etc.?


--Rob


Why the VS2013 App cannot get file in the App package?

Since the error says that the file can't be found I'd start by checking that the file is in the appxpackage. Make sure the database is flagged as content and to be copied to the output directory, and after building make sure it's in the AppX directory.


The error from GetFileFromPathAsync is because ms-appx:... is not a path and cannot be passed to that function.


--Rob


Conditional expression

Hi ALL


I need to perform coloring based on below condition?


like ;


IF group id =1 and Current hours between










1 A:M - 9 A:M and col1 >1 then red.

How Can I right Expression..


Please help


Conditional expression

I'm using nested table based on group by product id ..


this will be static in that case.


Conditional expression

Hi BI_group,


In Reporting Services, we can use switch function to return the value associated with the first expression in a series that evaluates to true. So in your scenario, if you want to display different color based on multiple groups, we can use the expression below in the BackgroundColor property of the cell which you want to highlight color .



=switch(Fields!ProductID.Value = 1 And Hour(Now()) >= 1 And Hour(Now()) <=9 And fields!col1.Value>1,"Red",
Fields!ProductID.Value = 2 And Hour(Now()) >= 1 And Hour(Now()) <=9 And fields!col1.Value>1,"Yellow",
Fields!ProductID.Value = 3 And Hour(Now()) >= 1 And Hour(Now()) <=9 And fields!col1.Value>1,"Green")



For more information about switch function, please refer to the following link:

http://www.bidn.com/blogs/ChrisAlbrektson/bidn-blog/1478/ssrs-switch-function-examples



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



Thanks,

Katherine Xiong


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.


XML to class diagram

I think you may want to use a treeview object for your diagram.


jdweng


Setting Password to Mdb File through C# code

I want to set Password to MS Access 2010 file through C# code. Can you help me?



try
{
if (File.Exists(FilePath))
{
string OledbConnectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;User Id=Admin;Password={1};Data Source={0};Mode=12;", FilePath, OldPassword);
using(OleDbConnection con = new OleDbConnection(OledbConnectionString))
{
string sql = string.Empty;
sql = string.Format("ALTER DATABASE PASSWORD [{0}] [{1}]", NewPassword, OldPassword);
OleDbCommand cmd = new OleDbCommand(sql, con);

con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
return "";
}
else
{
return "File does not exist.";
}
}
catch (Exception ex)
{
return ex.Message;
}

When I run this code for the 1st time,it is getting executed successfully. But for the next time,it is giving me exception that "Cannot start your application. The workgroup information file is missing or opened exclusively by another user.".

Setting Password to Mdb File through C# code

Once the file is password protected, you should use the following connection string


string conString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="Path to your access file";Jet OLEDB:Database Password=password";











A.m.a.L Hashim

Microsoft Most Valuable Professional

My Blog - Dot Net Goodies

Setting Password to Mdb File through C# code

Thank you so much. Its working fine with this connection string. Only 1 more parameter needs to be added.

string conString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="Path to your access file";Jet OLEDB:Database Password=password;Mode=12";



Here Mode is for exclusive open of file.

How to fetch all separated result in Stored Procedure with While Loop


Hello Everyone,


That is the query result of my stored procedure (with while loop). The problem is when I fetch it using :


While sqlreader.read


.....


End While


It only reads one row. Is there a way to fetch all that result even if they are being separated by While Loop in my Stored Procedure?


Thank you guys.


- Charlie


How to fetch all separated result in Stored Procedure with While Loop

I think you should try differently like to get all your records in a single table (SET based approach rather than While or cursor based.) and use that single table to populate in application layer.


Please write your logic to use Set based approach, whcih is good for performance of your system too.




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


How to fetch all separated result in Stored Procedure with While Loop

Hello Sir Latheesh,


I made it all fetched by using .NextResult and Do While loop :



Do
While sqlReader.Read
drow("col") = sqlreader("col")
End While
Loop While Me.sqlReader.NextResult



Thank you Sir for your attention.


- Charlie



Terrible display of RS reports using Report Viewer 2012 and IE 10

I have recently updated to Report Viewer 2012 control and updated my ASP.NET application to use it.


The control works very well in all major browsers except IE 10.


In IE 10 the scrollbars are often missing and the display is also awful. See the attached picture.



If I click Compatibility View button the report displays properly as shown in the second picture (scrollbars are present, too).



Is this a bug that's going to be fixed soon?


Thanks,


Stan


SSRS report subscription error ...Index was outside the bounds of the array error

Hello,


Please check if the issue also general in other browser, and if it is a random occurrence?


Since the issue is related to internal application, I recommend you that submit a feedback to the Microsoft Connect at https://connect.microsoft.com/SQLServer/Feedback. Your feedback is valuable for us to improve our products and increase the level of service provided.


Best regards,

Alisa Tang




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.


SSRS report subscription error ...Index was outside the bounds of the array error

Hello,


I checked in chrome and firefox also but same problem is there .Also redeployed it but same result(error).Same problem is there with 2-3 other reports also.Reports ran properly in local(IDE) as well as on report server .


Thanks,


Padmaraj




Opening InfoPath 2007 template of another sharepoint 2007 farm

Hi JCS_3,


This seems wield, did you have the template that are also deployed to farm B? otherwise, i’m not sure why SharePoint try to open the form from farm B.


Please try to republish the form with version changed, in the Form Design mode, go to Tools->form options->versioning, and update the version number manually, republish the form.


Does this happen to all users or only one user, if it is for one user, this may be caused by the cached version. Remove the user’s local profile under Documents and settings, when the user login again, it will create a new one for him.


If it isn’t the issue, please feel free to let me know.


Thanks,




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.


Display folder items in a webpart

Any idea how can i achieve this???


Regards, Shreyas R S


Versionning Document library sharepoint

hi ,


i have configured versioning for my document library and when clicking on a document i have a popup with " extract and edit" message.


I would like that when a user is extracting a document for editing , when another user try to edit the document at the same time he must not receive the same message " extract and edit".


How to achieve this requirement.


Thanks


Running Exe with Arguments with write action using C#

Hi All,


I need to do an action that can be acheived by executing the following command in command prompt:


"exe file" "Input file" >"OutputFile"


which means I am writing the data into the second argument file.


Now for the same I am trying to do the same in C# coding as displayed below, but its not working.


Process myProcess = new Process();

myProcess.StartInfo.UseShellExecute = true;

myProcess.StartInfo.FileName = @"""E:\aa ePUb-XML\xmlvalid.exe""";

myProcess.StartInfo.Arguments = String.Format("\"{0}\" >\"{1}\"", @"E:\aa ePUb-XML\Test Files\45644.xml", @"E:\aa ePUb-XML\Test Files\Log.xml");

myProcess.StartInfo.CreateNoWindow = true;

myProcess.Start();

myProcess.WaitForExit();

myProcess.Close();



Any help/Suggestion appriciated.


Thanks,


Christober


Running Exe with Arguments with write action using C#

I don't know why there is a ">" between the 2 parameters, looks like it causes some confusion here.


One workaround I can think of is you generate a .bat file that contains this command and run that .bat file from C#.




Cheers, Daniel


How to fetch all separated result in Stored Procedure with While Loop


Hello Everyone,


That is the query result of my stored procedure (with while loop). The problem is when I fetch it using :


While sqlreader.read


.....


End While


It only reads one row. Is there a way to fetch all that result even if they are being separated by While Loop in my Stored Procedure?


Thank you guys.


- Charlie


Bandwidth

Sandeep,it is a difficult to answer your question without knowing your workload, data distribution etc...


I would suggest you to do a Capacity planning and reach your breaking point for the server resources. This way, you will be able to come to a closer suitable value for your Server resources.




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


Why the VS2013 App cannot get file in the App package?

Hi Kevin,


I am moving your thread into the Building Windows Store apps with C# or VB Forum for dedicated support. Thanks for your understanding.


Best 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.

Click HERE to participate the survey.


Set Custom Master URL using JS CSOM in SP 2010

How to set custom master page using JS CSOM in SP 2010? Can anyone please explain?

Set Custom Master URL using JS CSOM in SP 2010

Hello,


Here is code to change master page using CSOM:


https://www.nothingbutsharepoint.com/sites/devwiki/articles/Pages/SharePoint-Online-Changing-Master-Page-through-CSOM.aspx


Hope it could help




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

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


Set Custom Master URL using JS CSOM in SP 2010

Thanks a lot for the response. But I know that it is possible in 2013. I am looking to achieve this in SP2010. Please check the title of the post.

Set Custom Master URL using JS CSOM in SP 2010

I have also tested and It seems that does not works in SP 2010. Could you use object model?



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

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


Set Custom Master URL using JS CSOM in SP 2010

I prefer doing it using Sandbox or JS (preferably client side). Can you please let me know, how to achieve this in Sandbox?

Set Custom Master URL using JS CSOM in SP 2010

Here is link for sandbox:


http://aarebrot.net/blog/2010/10/activating-a-customized-master-page-with-a-feature-using-a-sandboxed-solution-in-sharepoint-2010/




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

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


Set Custom Master URL using JS CSOM in SP 2010

Thanks a lot once again for the prompt response. But I would like to do this on the click of Ribbon button in Sandbox.


Set Custom Master URL using JS CSOM in SP 2010

Follow belwo link to add button in ribbon. You first need to add your sandbox webpart in site page then open that site page when click on button.


http://msdn.microsoft.com/en-us/library/ff407458%28v=office.14%29.aspx


http://social.technet.microsoft.com/Forums/sharepoint/en-US/dad32867-4d14-4bb4-a791-d46fc2768285/need-to-add-custom-button-to-sharepoint-2010-publishing-pages-ribbon?forum=sharepointgeneralprevious


You need to put your page URL in JS (CommandAction="javascript:window.open(custompageurl)).


Hope it could help




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

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


SharePoint 2010 FBA - unable to add users

Hello,


>noticed that user is not registered.


Before go ahead, could you confirm that user is added in "aspnet_Users" table? If user does not exists in this table then that user won't be able to login. If user is added in table then you have to add and provide permission to that user into sharepoint site too.


Yes, you have to make entry on all WFE's as well.


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




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

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


SharePoint 2010 FBA - unable to add users

>I am not sure, what the developer has done in Test Server


Developer has created users in test server n that table that's why it is working in that environment. You need to create user in membership table then only you can add user in sharepoint site. See this link for your information to create user in membership table:


http://www.codeproject.com/Articles/352841/How-to-Configure-Form-Based-Authentication-FBA-in


If you are not developer then ask your developer to create user in production environment OR you can also follow above link to create users.


>ike I am thinking to take a backup of test server and restored on Production


Take backup of your membership DB from test and restore in prod SQl server. Later you need to change the DB name in all the web.config files.




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

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


Simultaneous user connections

Enabling "Data Feed" export in ASP.NET Report Viewer control

Hi Dhanapal,


In SQL Server Reporting Services (SSRS), it has Export as Data Feed button in Report Manager, SharePoint, or a report server.


Based on my search, you can try to installing the Visual Studio 11 beta. It is an updated version of the control in there.

Reference: http://stackoverflow.com/questions/10345963/reporting-services-2012-reportviewer


Regards,

Alisa Tang




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.


AND operand

AND in C# and C++ is &&


& is a bit wise AND


&& is a logical AND




n.Wright


AND operand

thank you guys worked a treat


Mark


Rendering or Exporting a SSRS 2008 report to RTF











I am using Microsoft.ReportViewer to display SSRS reports from my C# desktop application. The ReportViewr by default provides the 3 modes of export features, 1. Excel. 2. Word, 3. PDF. Now we want another export capability of RTF. Does any one have any idea how to convert the SSRS reports to RTF format?





Find difference between two custom list objects



public class Details
{
public String classNAme;
public List<Student> studentCollection;
}
public class Student
{
public string Rollnumber, Name;
public List<Marks> studentMarks;
}
public class Marks
{
public string Eng, Maths, Term;
}



Old XML
----------
<Details>
<Class>1.0</Class>
<Student RollNumber="001" Name="Aaa">
<Marks Eng="50" Maths="50" Term="First"/>
<Marks Eng="60" Maths="57" Term="Second"/>
<Marks Eng="55" Maths="56" Term="Third"/>
<Marks Eng="59" Maths="85" Term="Fourth"/>
</Student>
<Student RollNumber="002" Name="Baa">
....
</Student>
</Details>
New XML
----------
<Details>
<Class>1.0</Class>
<Student RollNumber="001" Name="Aaa">
<Marks Eng="50" Maths="60" Term="First"/>
<Marks Eng="60" Maths="57" Term="Second"/>
<Marks Eng="55" Maths="46" Term="Third"/>
<Marks Eng="59" Maths="85" Term="Fourth"/>
</Student>
<Student RollNumber="002" Name="Baa">
....
</Student>
</Details>

HI All, Using XELement.Load I have loaded the xml into the above class. My class and XML structure are given above.
I have a requirement where I have to compare two xml files. In hte new XML, Marks for a student(s) might change for a particular term(s).
I need to identify the student and the term for which eth marks has been chnaged.
can u plz let me knwo how to get the difference between tow list<Marks> object.
I would be holding hte object like,
Details oldDetails = GetDetails(path1);
Details newDetails = GetDetails(path2);
Thanks,




Unable to catch automatically raised exception using derived exception class in catch block

Hi all, I am having problem in catching exception raised by .Net using custom exception in catch block.


What I did is I created a custom exception class derived from Exception, following is the code:



[Serializable]
public class DerivedException : SystemException, ISerializable
{
public DerivedException()
{
//
// TODO: Add constructor logic here
//
}
public DerivedException(string message)
:
base(message)
{
}
public DerivedException(string message, Exception inner)
:
base(message, inner)
{
}
protected DerivedException(SerializationInfo info, StreamingContext context)
:
base(info, context)
{
}
}

Then I then I tried to cause the exception using following code:



public void OpenThisFile()
{
try
{
File.Open(@"c:\test1234.txt", FileMode.Open);
}
catch(DerivedException ex)
{}
}

I the File.Open(... method I choose the file name which does not exist, so that this method cause exception. However, when the exception raised catch block does not catch it... can some body tell me why it is happening and how to get the exception caught using custom exception.


Any help in this regard would be heighly appreciated.


Unable to catch automatically raised exception using derived exception class in catch block

That is because, if the file doesn't exist IOException is thrown but not DerivedException. Hence, your catch block will not catch the exception. To test it, you can manually throw an exception of type DerivedException.



public void OpenThisFile()
{
try
{
throw new DerivedException();
}
catch(DerivedException ex)
{
}
}



I hope this helps.




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


C# server in window and C client in linux

I wrote C# server in window and C client in Linux.


my c# server is



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using System.Drawing.Imaging;


namespace server_window
{
public partial class Form1 : Form
{
Socket m_mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint iplocal = new IPEndPoint(IPAddress.Any, 1234);
Socket client;
IPEndPoint newclient;
public Form1()
{
InitializeComponent();
BW_Connection.RunWorkerAsync();
}

private void BW_Connection_DoWork(object sender, DoWorkEventArgs e)
{
m_mainSocket.Bind(iplocal);
m_mainSocket.Listen(4);
client = m_mainSocket.Accept();
newclient = (IPEndPoint)client.RemoteEndPoint;
this.Invoke(new MethodInvoker(delegate { TB_text.Text = "Client connected..."; }));
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
client.Close();

}
}
}

my C client program iin linux is



#include <sys/socket.h> //for socket(), connect(), sendto() and recvform()
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h> // for printf() and fprintf()
#include <string.h> //for memset()
#include <stdlib.h> //for atoi() and exit()
#include <unistd.h> //for close()
#include <errno.h>
#include <arpa/inet.h> //for sockaddr_in and inet_addr()


#define SERVERPORT 1234

int main ( )
{
int sockfd, n;
struct sockaddr_in serv_addr;
struct hostent *serverINFO;

char buffer[256];
char hostname[1024];
//struct hostent* h;
gethostname(hostname, sizeof(hostname));
serverINFO = gethostbyname(hostname);

if(serverINFO == NULL)
{
printf("Problem interpreting host\n");
return 1;
}
sockfd = socket(AF_INET, SOCK_STREAM, 0);

if (sockfd < 0)
{
printf("Cannot create socket\n");
return 1;
}
serv_addr.sin_family = serverINFO ->h_addrtype;
memcpy((char *) &serv_addr.sin_addr, serverINFO->h_addr_list[0], serverINFO->h_length);
//serv_addr.sinport = htons(SERVERPORT);
//bzero((char *) &serv_addr, sizeof(serv_addr));
//serv_addr.sin_family = AF_INET;
//memcpy(&serv_addr.sin_addr, server->h_addr, server->h_length);
//bcopy((char *)server->h_addr,(char *)&serv_addr.sin_addr.s_addr,server->h_length);
serv_addr.sin_port = htons (SERVERPORT);

if(connect(sockfd, (struct sockaddr *)&serv_addr, sizeof (serv_addr)) < 0)
{
printf("Cannot connect\n");
return 1;
}
printf("Please enter the message: ");
bzero(buffer, 256);
fgets(buffer,255,stdin);
n = write(sockfd, buffer, strlen(buffer));

if (n < 0)
printf ("ERROR writing to socket");
bzero(buffer, 256);
n = read (sockfd, buffer, 255);

if (n < 0)
printf ("ERROR reading from socket");
printf("here we are %s\n", buffer);
close(sockfd);
}



I run each program in one PC. I used cross cable to connect both pc. But when i run both program, the client terminal showed that "cannot connect". :(.. how can i get the connection between these two? if my code is wrong, pls kindly guide me. thanks a lot

C# server in window and C client in linux

Mine is using TCP.

C# server in window and C client in linux

Hi, firstly thanks for your answer. I change my server code a little bit by using TCP Client.



namespace server_window
{
public partial class Form1 : Form
{
static TcpListener tcpListener = new TcpListener(IPAddress.Any, 1234);
TcpClient socketForClient;
public Form1()
{
InitializeComponent();
// BW_Connection.RunWorkerAsync();
}
private void BW_Connection_DoWork(object sender, DoWorkEventArgs e)
{
tcpListener.Start();
socketForClient = tcpListener.AcceptTcpClient();
this.Invoke(new MethodInvoker(delegate { TB_text.Text = "Client connected..."; }));
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
socketForClient.Close();

}

}
}

Is my code right? And my client and server are running on different PCs. I connected these 2 PCs with crossover cable.

C# server in window and C client in linux

my client program is



#define SERVERPORT 1234

int main ( )
{
int sockfd, n;
struct sockaddr_in serv_addr;
struct hostent *serverINFO;

char buffer[256];
char hostname[1024];
//struct hostent* h;
gethostname(hostname, sizeof(hostname));
serverINFO = gethostbyname(hostname);

if(serverINFO == NULL)
{
printf("Problem interpreting host\n");
return 1;
}
sockfd = socket(AF_INET, SOCK_STREAM, 0);

if (sockfd < 0)
{
printf("Cannot create socket\n");
return 1;
}
inet_pton(AF_INET, "192.168.0.1",&(serv_addr.sin_addr));
serv_addr.sin_port = htons (SERVERPORT);

if(connect(sockfd, (struct sockaddr *)&serv_addr, sizeof (serv_addr)) < 0)
{
printf("Cannot connect\n");
return 1;
}
else
printf("Connected\n");
}

my server program is



namespace server_window
{
public partial class Form1 : Form
{
static TcpListener tcpListener = new TcpListener(IPAddress.Parse("192.168.0.2"), 1234);
TcpClient socketForClient;
EndPoint ep;
public Form1()
{
InitializeComponent();
BW_Connection.RunWorkerAsync();
}

private void BW_Connection_DoWork(object sender, DoWorkEventArgs e)
{
tcpListener.Start();
socketForClient = tcpListener.AcceptTcpClient();
ep = socketForClient.Client.RemoteEndPoint;
this.Invoke(new MethodInvoker(delegate { TB_text.Text = "Client connected..."; }));
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
socketForClient.Close();

}

}
}


C# server in window and C client in linux

I think that AF_INET is for IPV4 and SOCK_STREAM is for TCP. Am I right? this is my understanding :(


C# server in window and C client in linux

Can I use teraterm to check connection?

C# server in window and C client in linux

u mean my firewall set up in my window computer right? I made mark in Simple TCP/IP services, Tablet PC components, telnet server. Is this correct? for ping, I only use IP address of each computer. I used "ping ipaddress of remote pc 1234" it showed bad parameter 1234. why is it so?

C# server in window and C client in linux

I only have teraterm in my computer. Coz all terminal emulators are controlled by my company. They only put teraterm.

C# server in window and C client in linux

I am using window 7. The link you gave me is only for window vista right? so I found a link http://windows.microsoft.com/en-sg/windows7/open-a-port-in-windows-firewall but don't know how to do inbound rule. thanks

C# server in window and C client in linux

Hi thanks for your answer. Teraterm have TCPIP mode. I run my server application first. And use teraterm to connect to loopback address. It says connection refused. And also try with server IP address, still the same. connection refused. and what is Ultrix? So sorry. I am a bit stupid :(

store data into database through console application in c#.net.

Hi experts, Good Morning to all


I want to store some of the fileds like


name (string type)


id (number type)


gender (radio button type)


Department (dropdown type)


and some of the other fileds into sql server database


---> using console apps i want to design and develop the program to store the aboe fileds,


Please send any article to related this topic


Thanks and Regards,


Dhayanand Kalimidi


store data into database through console application in c#.net.

Unable to catch automatically raised exception using derived exception class in catch block

Hi all, I am having problem in catching exception raised by .Net using custom exception in catch block.


What I did is I created a custom exception class derived from Exception, following is the code:



[Serializable]
public class DerivedException : SystemException, ISerializable
{
public DerivedException()
{
//
// TODO: Add constructor logic here
//
}
public DerivedException(string message)
:
base(message)
{
}
public DerivedException(string message, Exception inner)
:
base(message, inner)
{
}
protected DerivedException(SerializationInfo info, StreamingContext context)
:
base(info, context)
{
}
}

Then I then I tried to cause the exception using following code:



public void OpenThisFile()
{
try
{
File.Open(@"c:\test1234.txt", FileMode.Open);
}
catch(DerivedException ex)
{}
}

I the File.Open(... method I choose the file name which does not exist, so that this method cause exception. However, when the exception raised catch block does not catch it... can some body tell me why it is happening and how to get the exception caught using custom exception.


Any help in this regard would be heighly appreciated.


Unable to catch automatically raised exception using derived exception class in catch block

That is because, if the file doesn't exist IOException is thrown but not DerivedException. Hence, your catch block will not catch the exception. To test it, you can manually throw an exception of type DerivedException.



public void OpenThisFile()
{
try
{
throw new DerivedException();
}
catch(DerivedException ex)
{
}
}



I hope this helps.




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


Join the two Query

Do you have another table whihc has mapping between ParentCustomerCode with CustomerCodes?


Eg: abc,abcd,adbc are mapped to ABC or something?




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


Join the two Query

Hi Latheesh ,


Org_Store is the only look up table for the store table where on the basis of the org_id u can group the customer codes.Its a weird DB Design & Implementation :(


Thanks


Delete statistics option is disabled when you try to delete statistics in sql server

Hi Latheesh,


If Statistics is maintained by any index, the drop index command will also be not able to remove it, until the index exits.




Regards Harsh


Delete statistics option is disabled when you try to delete statistics in sql server


Hi Latheesh,


If Statistics is maintained by any index, the drop index command will also be not able to remove it, until the index exits.




Regards Harsh



Thast perfect!! DROP statistics will work only for auto generated Statistics collection not for index statistics.


May be I did not mention in the second stament explicitly. Sorry for the confusion.




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



Playlist.LoadAsync unauthorized access exception

Hi


I am attempting to load a playlist present on the users computer (format is supported).


However, regardless of the playlist's location, I get an unauthorized access exception.


I've added pretty much all the capabilities to the project that have to do with handling playlists and media files in general. It made no changes whatsoever.


It is also irrelevant of the playlist's location (I haven't tried to store the playlist in app data folders, though), but the exception is thrown if the playlists is inside the music or video libraries.


So, any clue as why this is happening? Is this a bug? Do I have to write my own playlist decoding engine? thanks.


Using windows 8.1 and VS 2013 RC


Playlist.LoadAsync unauthorized access exception

How are you getting the StorageFile? Do you get unauthorized access from the StorageFile itself or only from the PlayList class?


--Rob


Playlist.LoadAsync unauthorized access exception

I get the storagefile from KnowFolders.Playlists.GetFilesAsync() method.


It appears the Playlist.LoadAsync() method is throwing the exception. I tried opening a stream on the same file and it appeared to have worked properly (I can read its file properties).



Playlist.LoadAsync unauthorized access exception

Hi Mcosmin,


Do you know where the tracks the playlist refers to are? This sounds like a known problem where the playlist will fail if any of its tracks are not accessible.


There isn't a workaround short of implementing your own playlist code.


--Rob


Playlist.LoadAsync unauthorized access exception

You are probably right. The files in the playlist are on the desktop.


I ended up removing the ability to read playlists not created by the application. If it is created by the application it means it will only have files to can reach.


AppointmentManager.ShowAddAppointmentAsync works on Windows 8.1 Pro but not Windows 8.1 RT ?

Hi,


In out application, we are using AppointmentManager.ShowAddAppointmentAsync to display the popup to add an item on the calendar.


This works fine on Windows 8.1 Pro but does not work on Windows 8.1 RT (a popup saying "No apps are installed to complete this task (Windows.appointmentsprovider.addappointment...)")


Is is a known bug ??


Thanks,




Thomas Lebrun [MVP] - Windows 8 / Windows Phone / WPF / SL: http://blog.thomaslebrun.net


AppointmentManager.ShowAddAppointmentAsync works on Windows 8.1 Pro but not Windows 8.1 RT ?

Hi Rob,


Thanks for your answer.


Both of my machines are installed with the Calendar application and this one works fine on both machines.


So I don't understand why I can see the popup on Windows 8.1 Pro and not RT (also, the popup which appears on Windows 8.1 Pro shows the Calendar data).


Thanks,




Thomas Lebrun [MVP] - Windows 8 / Windows Phone / WPF / SL: http://blog.thomaslebrun.net


AppointmentManager.ShowAddAppointmentAsync works on Windows 8.1 Pro but not Windows 8.1 RT ?

Hi Thomas,


I suspect you don't have the latest version of the Calendar app on your Windows RT system. We just confirmed that Calendar version 17.5.9600.20279 works as an appointment provider on Windows RT.


--Rob


AppointmentManager.ShowAddAppointmentAsync works on Windows 8.1 Pro but not Windows 8.1 RT ?

Hi Rob,


Thanks for your reply.


My Windows RT have been upgrade from Windows 8 to Windows 8.1 so I was hoping the latest version of the application was installed but it dont seems to be the case: on my Windows 8.1 RT, the application version is 17.4.96000.XXXX


How can I manually update the calendar app on my Windows 8.1 RT system ?


Thanks,




Thomas Lebrun [MVP] - Windows 8 / Windows Phone / WPF / SL: http://blog.thomaslebrun.net



ssrs 2008 tooltip

Hi Wendy,


Base on my research and testing, there is no any property to change the font size and the style in a tooltip in Reporting Services currently. And there is no length limitation for the tooltip content. If you have any concern about change the font size and the style in a tooltip, you can submit a feedback at http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that they can be, Microsoft might consider add this feature in the following release after official confirmation.


Thank you for your understanding.


Regards,

Charlie Liao


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




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.



Tuesday, October 29, 2013

Couldn't they have picked a better word than "await"?

await means:


Asychronizedly Wait——This explaination is more suitable in my mind;)




Click For donating:Free Rice For the poor

For spamming-sender issues, you can either report it at Microsoft Spamming Issue , or just find "Report Spam Here+Number" at Forum Issue ;You can also find "Verify Your Account+Number" at "Forum Issue", where you can submit to be confirmed to paste links or images.

For more things to talk about? StackOverFlow is your choice.


Couldn't they have picked a better word than "await"?

Except your both overlooking something fundamental, there is no 'wait' involved at all. The calling thread is actually striving to avoid waiting (aka 'blocking') which is why I find the term utterly inappropriate.


The calling thread does indeed start something, it starts an asynchronous operation then promptly exits, resuming execution at the next statement only once the operation completes.


"start" and "begin" are wholly appropriate which is why the earlier asynchronous model (prior to C# 5) had methods names starting with "Begin".


The fact that you thought a wait was taking place only goes to show how misleading "await" is.


Cap'n


SQL Server Error - HRESULT E_FAIL has been returned from a call to a COM component


It's better to use sqlcmd to execute such big files. For more info see this link:


error hresult e_fail has been returned from a call to a com





Saeid Hasani, sqldevelop.wordpress.com



Download Books Online for SQL Server 2012


Why when i save from the pictureBox1.Image the image to the hard disk the size is smaller then the pictureBox1 size ?

The pictureBox1 size is: 1381,494

The image inaise is stretch.

Then im doing:



private void trackBar2_Scroll(object sender, EventArgs e)
{
LoadPictureAt(trackBar2.Value, sender);
label1.Text = "Image Number: "+ trackBar2.Value.ToString();
pictureBox1.Refresh();
counter++;
pictureBox1.Image.Save(@"d:\CloudColorsFiltered\" + "AnimatedImageColors" + counter.ToString("D6"), System.Drawing.Imaging.ImageFormat.Gif);
}



This is the two lines i just added now:



counter++;
pictureBox1.Image.Save(@"d:\CloudColorsFiltered\" + "AnimatedImageColors" + counter.ToString("D6"), System.Drawing.Imaging.ImageFormat.Gif);

The image the gif on my hard disk is 512,512 size

Why its saving the gif so small and not as the size of the pictureBox1 ?

Limit to number of INSERT statements or VALUES clauses

below style has limitation of 1000


Insert into Table (Column) values ('value1'), ('value2'), ('value3'), ('value4'), ('value5')



two work around, you can use


Insert into Table (Column) values ('value1')


Insert into Table (Column) values ('value2')


Insert into Table (Column) values ('value3')




Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker

--------------------------------------------------------------------------------

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------------------------------------------------------------------

My Blog | Team Blog | @Twitter

Author: SQL Server 2012 AlwaysOn - Paperback, Kindle


Grid.Children.Add is not setting the parent property of the added element

Hi,


I have a grid defined in XAML.


In C# i am adding FrameworkElement objects to the grid by


gridObject.Children.Add(elementObject);


Grid.SetRow() Grid.SetColumn();


it seems as though the Parent property of the element is not getting set to the gridObject.


Does anyone know what is casuing this?


Grid.Children.Add is not setting the parent property of the added element

Hi C.J.


There is some asynchronicity going on inside the Add. If you wait a moment the Parent should be set, but it doesn't get set immediately.


--Rob


Grid.Children.Add is not setting the parent property of the added element

Hi Rob,


So I tried to add


await Task.Delay(5000);


directly after i add the element to the Grid.


In debug mode i can't get it to go past the await line


What have i done worng?


Grid.Children.Add is not setting the parent property of the added element

I added a element.UpdateLayout() call in there which is getting the job done.

caching in usercontrol xaml c# metro app

Could you elaborate a little more on what you need to cache and how you are caching in the page? It should be the exact same concept for a UserControl as a Page.


Thanks,


Brad


Report parameter variable in SSRS 2008 R2

Hi all.


Could someone please let me know if the following is possible in SSRS 2008 please.


I'm trying to create a report parameter variable where by I can store what I want the report to show in the column group. For example break down by age group, gender or ethnicity but only one of them. I can do this in SAS Enterprise Guide, just create a paramerter variable, but as we only use SSRS for surfacing reports on the web I wondered if the same could be done in SSRS 2008.


Could someone let me know if the functionality exists?


Many thanks


Report parameter variable in SSRS 2008 R2

Report parameter variable in SSRS 2008 R2

Hi,


Thanks for your response. I've followed the blogs and tried to implement something but it is not returning what I want, and it could just be either I haven't explained what I'm trying to do correctly or I'm implemeting it incorrectly in which I'll just keep going with it if it's me.


To clarify what I'm trying to do is to create a single SSRS report and have the total number requests in the table by organisation, so I get one row for each organisation. Then I wish to add in a parameter so that I can then split the row total for each group up by the selected variable. For example age group or gender.


The user, at their discretion, can change which variable they want to break the data down by but can only break it down by one at a time.


I don't want to create several reports, one for each dimension, but just one report with a variable drop down list.


Essentially I'm looking to do something like:


case when parameter = AgeGroup then columngroup = AgeGroup


when paremeter = Gender then columngroup = Gender


etc. as the paraemter will be coming from a fixed list, however I don't know how to pass the parameter value to become the column grouping.


Thanks



Report parameter variable in SSRS 2008 R2

People picker issue in Modal dialog box

We have a page with People picker ( <SharePoint:PeopleEditor> ) control added to it.

This page is opened as a Modal dialog box using SP.UI.ModalDialog.showModalDialog() from another page.



We have following issues in People picker only when we open the page as dialog box. Works fine if the page is opened as normal page



Issues:



1. Cannot remove the resolved name from the people picker control

2. When 'Remove' menu is clicked for an invalid user name, the input box goes invisible.


Issue is only in IE. Working fine in Firefox and Chrome. Using IE10




--Cheers






People picker issue in Modal dialog box

Hi,


Thank you for your question. I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience. Thank you for your understanding and support.


Best 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.