|
sorry ,
Thread.CurrentThread.CurrentUICulture = new CultureInfo("ru");
Thread.CurrentThread.CurrentCulture = new CultureInfo("ru-RU");
I expect , when my winform application will run
my default language will be russion is it true?
Evgeny
|
|
|
|
|
Yes, that should do it.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi all,
I'm using sql server that is with VS2005.i want create CrystalReport with wizard,but in connection information step(in section 7 of below list), i don't know what name i should select for server in server drop down list (there is no name for server in drop down list) that my data bases comes in drop down list for section 8 to choice my data base,
1. Start a new CR report from the Project menu in VS2005
2. Choose the Standard report expert
3. On the Data form, Expand 'Create New Connection"
4. Expand OLE DB(ADO)
5. Select SQL Native Client
6 Click Next and check Integrated Security. This will grey out the Sql autentication.
7. Select your SqlExpress Server name from the drop down list
8. Select your database name from the drop down list
9 Click Finish.
where is the problem?
please help me.
Thank You,
Hoda
|
|
|
|
|
At the time of installation of SQL, You checked the SQL Server Authentication instead of Windows Authentication. That why when you check the integarted security there is no server found.
Solution:
1- Write the system name + \SQLEXPRESS e.g. System Name is abc then write in the Server Combo abc\SQLEXPRESS
2- Uncheck the intgerated security and write username with password.
3- Reinstall the SQL with Window Authentication Mode.
|
|
|
|
|
Hello,
I am trying to connect a Crystal Report(an rpt file) to a Crystal Report viewer on run-time and using the ReportDocument object model as MSDN suggests.
Please consider the following lines of code:
<br />
ReportDocument rptDoc = new ReportDocument();<br />
rptDoc.Load("C:\\Report.rpt")<br />
<br />
...<br />
CrystalRptViewer.SetReportSource(rptDoc);<br />
When I execute my executable file, I observed that the application is rather slow for a very simple operation.
When I debugged, I observed that the compiler spends around 5 seconds in the above section of the code. (When an instance of the ReportDocument class is created.)
After research on google and Business Objects support forum, I saw that many people migrated to Crystal Reports 2008 has similar issues loading the report file.
Is there any suggestions to improve performance here?
Thank you
|
|
|
|
|
selcuks wrote: Is there any suggestions to improve performance here?
Crystal Reports is a 3rd party product therefore you should be asking that question in their forums.
led mike
|
|
|
|
|
Hi.
I included a Media Player control (AxWMPLib.AxWindowsMediaPlayer) in my C# app just for basic playback.
I set "autoStart" to false, and the URL to the song I want to play.
The buttons play/pause, stop, mute and the volume slider all work, but the forward and rewind buttons are disabled. Also the slider for current podition is disabled.
Do you have any clue how do I enable that? Thanks.
|
|
|
|
|
AFAIK you cant forward or rewind streaming audio.
|
|
|
|
|
I'm not streaming anything. It's a local file on my hard drive that I'm playing.
Just that the property of the Media Player control which identifies what to play is 'URL'...
|
|
|
|
|
There are a number of UI settings you can use, but I believe in all of them, the controls that are visible, should also work. Do you see the slider ? Can you click on it ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It's strange and it's got someting to do with the audio file fomat used. For a project I need some clear WAV files without ID tags. I ripped some from an audio CD using FreeRIP, because the Rip feature in Media Player doesn't have the option to ignore ID tags.
I noticed this:
- The MediaPlayer control in my C# app is able to scroll through mp3 file and wav file ripped with Media Player, but cannot scroll through wav files ripped with FreeRIP
- The stand-alone Media Player can scroll through any file, but the control can't.
Odd, really...
|
|
|
|
|
Maybe FreeRIP is making wierd wave files. A wave file isn't just a wave file, there's the number of channels (1 or 2), sample rates, bit rates, and formats. Make sure the wave files FreeRIP are producing are PCM or something like that.
Open up the files in windows sound recorder (sndrec32) and go File->Properties and see what it says, it should be something like PCM 48.000 kHz, 16 Bit, Stereo
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
How do you launch another application from within a C# project?
Imaging the following:
1. Make a button that will launch some app.
2. Users presses the button for the first time, you open a openfiledialog so he can browse to the exe.
3. Next time the user presses the button, you run the exe he had selected.
Simple, right? So how do you make the call if you know the path?
|
|
|
|
|
KennyODell,
MSDN[^]
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
1. Use application user settings (or any other method that works for you) to save the full path to the exe.
2. Do what the previous poster pointed you to.
3. The next time - use System.IO.File.Exists(....) to make sure the program is still there. If it is, do step 2 again - if not, redo steps 1 and 2.
Dave
|
|
|
|
|
Hi,
I am working on a windows application using C#.net. In my app I have to allow user to print report. Application should print record and each page must have 86 lines and each line consist of 134 characters. I have more then 86 records but its printing only 1 record. My code is :
PrintDialog printDialog;
PrintDocument printDocument;
printDialog.Document = printDocument;
printDocument.PrintPage += new PrintPageEventHandler(onPrintPage);
private void onPrintPage(object sender, PrintPageEventArgs e)
{
Graphics g = e.Graphics;
int x = e.MarginBounds.Left - 50;
int y = e.MarginBounds.Top - 50;
System.Drawing.Brush brush = new System.Drawing.SolidBrush(Color.Black);
try
{
g.DrawString(strPrint, new System.Drawing.Font("Courier New", 8, System.Drawing.FontStyle.Regular), brush, x, y);
}
catch (Exception ex)
{
}
In this method onPrintPage() we can find whether it has more pages or not but I am unable to solve this issue.
Can you please help me to find the solutions.
Best Regards,
Chandan Kumar
|
|
|
|
|
Kr_Chandan wrote: I have more then 86 records but its printing only 1 record.
Did you set HasMorePages = true in onPrintPage ?
|
|
|
|
|
Kr_Chandan wrote:
catch (Exception ex)
{
}
Maybe an exception is being thrown, but your code is pretending everything is OK?
Semicolons: The number one seller of ostomy bags world wide. - dan neely
|
|
|
|
|
strPrint variable in DrawString() has record to print. How can I know it is suppose to print 1 page or more then 1 page. please let me know. each page should print 86 lines and each line consist of 134 characters.
Best Regards,
Chandan Kumar
|
|
|
|
|
I am using NMock for creating mock objects. I have found a weird behavior of the expectations set on the object. Here is my code. (This code is just to explain the problem, and not used in production)
public class AccountServices
{
ICurrencyServices currencyService = null;
public AccountServices(ICurrencyServices services)
{
currencyService = services;
}
public string Total()
{
return "10" + currencyService.GetTotal();
}
}
public class CurrencyServices : ICurrencyServices
{
public string GetTotal()
{
return "10";
}
}
public interface ICurrencyServices
{
string GetTotal();
}
I am testing Total() method by mocking ICurrencyServices and injecting via constructor to AccountServices . Here goes my test method
[Test]
public void TestTotal()
{
Mockery mock = new Mockery();
ICurrencyServices currency = mock.NewMock<icurrencyservices>();
Expect.Once.On(currency).Method("GetTotal").Will(Return.Value("100"));
AccountServices services = new AccountServices(currency);
Assert.AreEqual("10100", services.Total());
}</icurrencyservices>
This works well. But when I add one more assert just down to the last assert
AccountServices services = new AccountServices(currency);
Assert.AreEqual("10100", services.Total());
Assert.AreEqual("10100", services.Total()); I am getting the following error.
"unexpected invocation of currencyservices.GetTotal()" . This problem will be solved if I add one more expectation before the last assert. It looks like each time I need to add the expectation before doing anything that calls "GetTotal ". Any idea why it works like this ? Why don't the expected value persist until the scope ends ?
|
|
|
|
|
Mocks are different than stubs. I'm not familiar with NMock (I use RhinoMocks myself), but the way it works is that
Expect.Once.On(currency).Method("GetTotal")
Set up your expection that GetTotal be called exactly once. Since you did
Assert.AreEqual("10100", services.Total());
Assert.AreEqual("10100", services.Total());
Calling it 2x is violating the expectation. If that's not what you desired, either change Expect.Once to Expect.Twice (again, not sure of the NMock syntax), or use a stub in place of the mock.
Life, family, faith: Give me a visit.
From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord."
Judah Himango
|
|
|
|
|
Thanks for the reply. Problem sorted. Expect.Once was making problem. I changed that to Expect.AtLeastOnce . BTW, what scenarios do you use a stub, and what are it's advantages over mock ?
Thanks again
|
|
|
|
|
In short, use stubs for canned results. Use mocks for verifying interactions (e.g. setting expectations). With stubs, it looks just like a real object:
myStub.Foo = 5; compared to
Expect.Call(myMock.Foo).Return(5);
See Martin Fowler's Mocks Aren't Stubs[^] article. MSDN had a good article about the difference between strict mocks, dynamic mocks, and stubs some time ago.
Life, family, faith: Give me a visit.
From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord."
Judah Himango
|
|
|
|
|
Thanks again. I have very mild usage of NMock, recently started. I have found for mocking interfaces are only used. Say I have a class which needs to be mocked ? Is there a way to go with this ?
Thanks
|
|
|
|
|
N a v a n e e t h wrote: Say I have a class which needs to be mocked ? Is there a way to go with this ?
Partly. Most mock frameworks, such as RhinoMocks, can mock abstract classes and the virtual members of non-sealed classes. Unfortunately, this doesn't work out well because, while C# classes are unsealed by default (good), methods and properties are non-virtual by default (bad). This means most classes you won't be able to mock.
Here at work, we almost always use interfaces. If a class A has a dependency on class B, we change the dependency to be an interface for easy testing and mock injection.
Now, there's one thing you ought to know. There is an extremely powerful mocking framework available -- more powerful than your NMock or my RhinoMocks, called TypeMock.NET. IIRC, TypeMock actually rewrites your IL during the testing phase, allowing you to do anything: mock sealed classes, mock static classes, mock non-virtual methods, mock anything. There's a free community edition available with paid commercial support: TypeMock.com[^]
Life, family, faith: Give me a visit.
From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord."
Judah Himango
|
|
|
|