|
Why did you delete your question? Don't do that.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
I have edited my answer to show what the OP asked.
|
|
|
|
|
Dear developers.
I developed a simple app that has a report viewer which connects to SQL server 2008.
i need to deploy the application to a terminal where all users can open it using a Shortcut to the exe trough Citrix.
My last app was in vb there where no problems there I just copied the exe file to the terminal and created the shortcut and everything worked fine.
Now I am using c# and the exe file trough an exception that the report viewer not found.
I tried the publishing it using ClickOnce and it is working.
The Q is can I only use the exe file and not publish the app? Because the shortcut targets only the exe file
Tanks,
Pniel
|
|
|
|
|
I would like to know if the following code is written ok or is there a better way? If there is a better way, can you explain and/or point me to a reference I can use? Is the linq writing from one datacontext object to some data fields ok? Also is the try catch adequate?
I do know the code works since I stepped through the code.
I am asking the question is this is my first time working with linq to sql in a C# 2010 application and I am the only programmer at my company.
<pre> protected void Ready_Data(Attes att, AtsDataContext attDataContext)
{
try {
var results = from s in attDataContext.Attes_Schedules
where s.Pay_Month == att.Pay_Month_Date
select new
{
PayDate = s.Pay_Month,
CurCStopDate = s.Current_C_Stop_Date,
PriorCStopDate = s.Prior_C_Stop_Date,
RptsReceviedMonth = s.Rpts_Rec_Month,
};
foreach (var r in results)
{
att.Pay_Month_Date = r.PayDate;
att.Current_C_Stop_Date = r.CurCStopDate;
att.Prior_C_Stop_Date = r.PriorCStopDate;
att.C_Rpts_Rec_Date = r.RptsReceviedMonth;
}
}
catch (Exception ex)
{
lblErrorMsg.Text = "Attes Page Processing problem";
lblErrorMsg.Visible = true;
hold_Exception = ex;
}
}</pre>
|
|
|
|
|
results is a collection you are integrating over yet att is a single object. That means if you have five items in results att will only be assigned the values in the last item when this method returns. If you only want/need a single item then use Single or SingleOrDefault method, or First or FirstOrDefault if that makes sense for you data
No comment
|
|
|
|
|
In this code I wanted to retreive the 5 items. I think this code returns all 5 items.
|
|
|
|
|
No it doesn't. You said you have stepped through the code. Didn't you notice the att object getting overwritten with new values each time? att is not a collection it is a single instance. Unless you have mistyped or not given complete information.
No comment
|
|
|
|
|
Just an FYI... you should not be writing LINQ2SQL code going forward as it has been COMPLETELY abandoned by Microsoft. They are now strictly on Entity Framework.
|
|
|
|
|
That's cool. Now I don't have to bother learning it!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
The link you included says pretty much what I said! Linq2SQL is not getting any new features and is in "maintainence mode". That means *all* new dev effort is going into EF. I never said Microsoft was REMOVING Linq2SQL, I just said they abandoned it. Your very own Linq (no pun intended ) makes it pretty clear that Linq2SQL is pretty much "meh... if we find a serious bug in it thats a show stopper, we MAY fix it".
But whatever .
All I was telling the OP was that Microsoft isn't going to be doing anything with it going forward, so any new features are going to be strictly EF, so he shouldn't waste his time building his app around it.
|
|
|
|
|
There is quite difference between abandoned and maintenance. Abandoned means no further support which is not the case.
No comment
|
|
|
|
|
I think you are just arguing semantics at this point. If Microsoft tells you "we aren't going to be developing this any further", it is your choice to ignore them and continue down a dead end path.
|
|
|
|
|
Microsoft aren't adding extensions to + and -, either. That doesn't mean you shouldn't use them. Linq to SQL is part of the language and the Framework, and will remain so, and it's much nicer to use in certain circumstances than the equivalent code with DbAdapters and DataSets. It's absolutely fine to use it even if it's not getting extended in future (which is a big step away from 'completely abandoned').
EF is massive overkill for a lot of applications, particularly if you already have a database and can't use its magic wand to match everything up.
|
|
|
|
|
|
So I am attempting to achieve a zoom effect similar to Microsoft Office Word. When you change the zoom the entire document "zooms" in/out. The text area, the text itself, etc. I have actually done this before but it has been quite some time. So I cannot remember how to do it. And I cannot find anything on Google anywhere, perhaps I looked over it?
I think it had something to do with the Graphics class for the control and such. The setup is a Panel with a RichTextBox on it. Anyone else aware of how to do this? I just need a link or two that describe it.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
I am using scaling to perform what you are wanting.
First create your slider in Xaml.
<StackPanel Orientation="Horizontal" x:Name="StatusBarSlider">
<TextBlock Foreground="#FF9585b9" Name="StatusBarItem" Margin="0,1,0,1" Padding="6,0,6,0" Text="{Binding ElementName=scaleSlider, Path=Value, Converter={StaticResource PercentageConverter}, ConverterParameter=%}" />
<RepeatButton Margin="1,0,1,0" CommandTarget="{Binding ElementName=scaleSlider}" ribbon:ScreenTipService.ScreenTipHeader="Zoom Out" Style="{StaticResource {x:Static ribbon:RibbonStyles.StatusBarSliderDecreaseButtonKey}}"/>
<Slider x:Name="scaleSlider" Width="100" Value="1.0" Minimum="0.5" Maximum="2.0" LargeChange="0.5" SmallChange="0.1" VerticalAlignment="Center" IsSnapToTickEnabled="True" TickFrequency="0.1" ribbon:ScreenTipService.ScreenTipHeader="Zoom" />
<RepeatButton Margin="1,0,1,0" CommandTarget="{Binding ElementName=scaleSlider}" ribbon:ScreenTipService.ScreenTipHeader="Zoom In" Style="{StaticResource {x:Static ribbon:RibbonStyles.StatusBarSliderIncreaseButtonKey}}"/>
</StackPanel>
Then I use this for the code controlling the slider.
ScaleTransform scaleTransform = new ScaleTransform();
Binding scaleXBinding = new Binding("Value");
scaleXBinding.Source = scaleSlider;
Binding scaleYBinding = new Binding("Value");
scaleYBinding.Source = scaleSlider;
BindingOperations.SetBinding(scaleTransform, ScaleTransform.ScaleXProperty, scaleXBinding);
BindingOperations.SetBinding(scaleTransform ScaleTransform.ScaleYProperty, scaleYBinding);
Contact2.LayoutTransform = scaleTransform;
Contact2 being the name of the form in which you wish to rescale.
I hope this helps. There are probably more efficient ways to achieve the same thing but this is what I did and it works perfectly fine.
|
|
|
|
|
I think the OP means to implement this in winforms, not WPF.
|
|
|
|
|
In that case is should be easier, same concept just use the slider control instead of Xaml.
|
|
|
|
|
You can manipulate the 'ZoomFactor' property of the RichTextBox[^], but be sure you are using TrueType fonts:Quote: The zoom feature performs optimally when the document contains TrueType fonts. When a font that is not TrueType is used within the document of the control, the ZoomFactor property will use the nearest whole number value. Disclaimer: I've never used this property myself, and I bet if you had pictures or whatever inserted in your RTF the results would be a mess.
Note if you are using .NET FrameWork Client Profile this will work only in 3.5 SP1, or later. If you're using the regular FrameWork, this feature has been in WinForms since 1.0.
Hope it works for you.
"I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone." Bjarne Stroustrop circa 1990
|
|
|
|
|
OK...so since no one answered, my communication skills must be at fault...let me try again please...
I am trying to add radio buttons to a panel that are outside the normal panel size. I know that it will scroll during runtime and in the past I have used cut and paste to accomplish this, but the question is how do I add the control into the panel in the first place since the panel cannot be expanded during development? I hope someone can see through this to understand the problem. Thanks for the time...Pat
previously I wrote:
Good Morning...perhaps it's been too long between programs...but...
I am trying to create a page that has a panel inside a tab control. In the past, it seems I used the panel control to allow scrolling, but previously I never had any controls on the panel that needed to be added that were outside the panel area. I know that I can create text and paste it in and it will scroll automatically, but what if I need to add controls (in this case radio buttons) and those controls are outside the entry range on the development page? There does not seem to be any way to add to the panel once you have reached the bottom...or is there? I am using Visual Studio 10.
Thank you for your help....Pat
modified 13-Nov-11 15:22pm.
|
|
|
|
|
WinForms .NET 4.0, VS 2010 Pro SP1
1. Create a WinForm project
2. Make the initial default Form1 800x600
3. put a TabControl on it: size it to taste
4. select any TabPage you've added (or one of the default two that are automatically created when you add the TabControl to the Form):
a. set the AutoScroll property of the selected TabPage selected to 'true
b. insert a Panel in the selected TabPage: set its Location to 0,0, and size to 1000x800:
Discussion: even with the Panel 'AutoScroll property set to 'false (in case you thought that that was a factor here): you can still scroll the TabPage at design-time and put Controls anywhere on the Panel.
But, you may notice a weird graphic hiccup that I consider a bug in WinForms: the bounding area of the Panel may appear to extend to the left of the TabControl in a way that has obviously nothing to do with the settings of the Panel: but, this has no effect on your ability to use the larger-than-TabControl Panel at design-time.
Also, if you copy and paste a Control which has been sited (for example at the right edge of your big Panel), you may be surprised the pasted Control appears outside the current viewport: but it's there and you may have to scroll around to find it and move it. Also, I think, a bug in WinForms. Although, to give the benefit of the doubt: is there any code of etiquette about what's supposed to happen when you copy and paste Controls in a container in terms of "placement" ?
I remember when I tried to do this once that I thought setting the Anchor property of the Control that was in the big Panel to 'Right would make the inserted Control "snap" to the right side of the big Panel, even if it was out-of-view at run-time: wrong.
In your case since you are using RadioButtons, and presumably are using them all in one container so that only one of them is "on" at any one time: why not just create some Panel or GroupBox or whatever, then site that where you need it to be in the big Panel, and then put all the RadioButtons in that ?
"I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone." Bjarne Stroustrop circa 1990
|
|
|
|
|
Thank you Bill,
Sometimes I AMAZE myself...how could I have missed something as basic as a property setting. I guess I can't see the forest through the trees. BTW...that works perfectly and solves my problem. I appreciate your time and input and am marking this reply as a correct answer. Best Regards, Pat
|
|
|
|
|
|