|
Hi again,
You could incorporate NUnit's logic in a test app and forgo the NUnit app itself.
I once did a small subset of NUnit; just supporting [TestFixture], [Test] and Assert.AreEqual takes some 100 lines of code, heavily using reflection.
BTW: You would still need a "using NUnit.Framework;" to reuse the types they have defined.
|
|
|
|
|
Hi to all ,
I am using ODBC connection to read from a excel sheet, but i am unable to read the first line of the excel sheet bcoz driver taking it as Header, i have some data in the first row how can i read it. And another problem is that i can not read the numbers from the excel sheet. These two problems i have solved with the OLEDB connection using HDR=No and IMEX=1 but how to solve this problem in ODBC... please Help me.
connectionString i am using :
Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=E:\newFile.xls;
Thank You
|
|
|
|
|
Hi again..
Im not very familiar with C# but i am wondering if its possible to change these codes to CHAR or String or even Boolean.
while (true)
{
// Divide by 80, get remainder
Random xRandom = new Random((int)(Cosmos.Hardware.Global.TickCount
+ Cosmos.Hardware.RTC.GetSeconds()));
int xMagicNo = xRandom.Next() % 80;
Debugger.Send("Magic Number is " + xMagicNo);
Console.WriteLine("I am thinking of a number between 0 and 80. What is it?\n");
while (true)
{
thanks.
|
|
|
|
|
I do not understand the question!
Which codes are you trying to change?
Is there more to read?
Why comment the unnecessary bit? (use xRandom.Next(80) and it will return a number between 0 and 79, just like your modulus)
Why use "% 80" and then expect 80 as a possible result?
BTW: If you use the "code block" button below, it will preserve your formatting, and make fragments easier to read, thus:
while (true)
{
Random xRandom = new Random((int)(Cosmos.Hardware.Global.TickCount
+ Cosmos.Hardware.RTC.GetSeconds()));
int xMagicNo = xRandom.Next() % 80;
Debugger.Send("Magic Number is " + xMagicNo);
Console.WriteLine("I am thinking of a number between 0 and 80. What is it?\n");
while (true)
{
|
|
|
|
|
Hi All,
i am busy trying to convert an int to a ReportWS.MonthlyDOWRecurrence, this is what i got
MonthlyDOWRecurrence pattern = new MonthlyDOWRecurrence();
pattern.WhichWeekSpecified = true;
pattern.WhichWeek = Convert.ToInt16(Combobox1.SelectedItem.Value);
but i always get the following error:
Cannot implicitly convert type 'int' to 'ReportWS.WeekNumberEnum'. An explicit conversion exists (are you missing a cast?)
In VB.Net it works if you say:
pattern.WhichWeek = CInt(Combobox1.SelectedItem.Value);
can someone please tell me how to correct this?
living life on the flip side
|
|
|
|
|
well i not familiar with the classes you are using but as the error is suggesting 'WhichWeek' is an enum value then you might want to try an enum parse. There should be an enum collection for the 'WhichWeek' type which will have a static Parse function.
Something like...
(WhichWeeks)WhichWeeks.Parse(typeof(WhichWeeks), Combobox1.SelectedItem.Value);
...I highly doubt that will work but hopefully you will get the idea of what you need to do
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
The answer is in the error message, just cast it:
pattern.WhichWeek = (ReportWS.WeekNumberEnum) ...
I assume this is C# (correctly) trying to ensure you are setting the enum to valid values only. (Your combo box can only return valid enum members, right?)
|
|
|
|
|
Try this:
pattern.WhichWeek = (ReportWS.WeekNumberEnum)System.Enum.Parse(typeof(ReportWS.WeekNumberEnum), Combobox1.SelectedItem.Value);
|
|
|
|
|
|
Do you want to insert the whole file into a field in the table? Or is your file a table (like a csv-file)?
First you have to write database access code to get a connection to the db...
Regards
Sebastian
|
|
|
|
|
|
For sql server
BLUK INSERT
For Oracle
SQLLDR
For MYSQL
INFILE
Use This Keywords to Search in Google.
Thanks
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
I find that some C# project is compiled with the makefile, so i want to know why use the makefile to compile it. Is it a best way to improve the programming skills?
What compiler do you use?
|
|
|
|
|
It makes no difference as far as I know, its generally down to the site standards and source control methods.
Fired.Fish.Gmail wrote: Is it a best way to improve the programming skills?
No, its not really that relevant any more than say using IE or FF for a browser.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Fired.Fish.Gmail wrote: What compiler do you use?
The compiler doesn't change whether you use a MakeFile, the IDE or an MSBuild project. It's always going to be csc.exe (for C#).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I Have seen the csc.exe file.
Thanks.
|
|
|
|
|
Hy,
I'm designing an application that accesses SQL Server from C#. I have a form that runs first where i select the sql server and database. When i click a button it's should assign the hostname and database for the connection string, close and open another form (the main application). The problem is when the select form closes, the main form appears for 1 sec and then the whole application closes. I've ran the app step by step, everything is ok, the variables are assigned but it automaticly calls the dispose method for the second form.
This is the code from the first form that runs at app start (selectserver form)
private void btnSelectServer_Click(object sender, EventArgs e)
{
<<assign values from control boxes>>
frmMain main = new frmMain();
main.Show();
this.Close();
}
|
|
|
|
|
1. In main entry point use your MainForm in Application.Run(new YourMainForm)
2. In your main form load event call your Sql Server Form Setting with showdialog and verify the settings
3. Close your Sql Server Form Setting.
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
But this way the main form would be loaded first. And I want to load the server form only, and if selected the appropriate server+database, close it and open the main form.
|
|
|
|
|
in main entry of your application use this
using (SqlServerForm sqlServerForm = new SqlServerForm())
{
if (sqlServerForm.ShowDialog() == DialogResult.OK)
{
Application.Run(new frmMain());
}
}
piticcotoc wrote: and if selected the appropriate server+database
set the dialog result of sqlserverform to OK to close the form
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Change:
private void btnSelectServer_Click(object sender, EventArgs e)
{
<<assign values from control boxes>>
frmMain main = new frmMain();
main.Show();
this.Hide();
}
-------
Nguyen Dai Duong
Ha Noi University of Technology
daiduongbk@gmail.com
|
|
|
|
|
Hi,
I am needed to implement an inventory control module but should I apply ORM for it? For the case, if I create a change (e.g. transfer from one warehouse to another warehouse), then the loaded stock value may be change by other, so how to use ORM for this case? or should not use ORM for this case?
Thanks
|
|
|
|
|
I don't see any difference in using an ORM for this or not. ORM are just a kind of tool to prevent you from writing database access code (insert/delete/update).
The question is not really clear. Maybe you could describe your requirements in more detail?
Regards
Sebastian
|
|
|
|
|
In my thinking of using ORM for inventory control, it should be get a stock, minus the request quantity, and then update to the database.
so if
inventory = 6
pc a = 6,
pc b = 6,
then pc a request to remove 2 items and process the value = 4 and then update to db,
but pc b keep the value = 6 and then remove 3 items, and the update to db,
it seen to be value = 3 in the inventory, it's about the concurrency control, how to let it better?
Thanks
|
|
|
|
|
Hi.
I want to know how you make an space between a statement in the code.
for example when i write Console.Writeline("I am john");
i want to leave some space between that statement and the next statement.
how u format it to leave some space between the lines?????
thanks.
|
|
|
|