This looks like you are getting the Column Value with GetColumnValue call. Not sure what Columns.IsRequired is, another property? My guess is that it comes from the table data. If that is correct then you are trying to set data in the table column with your setter.
Your problem seems to be that Columns.IsRequired is set to read only, not your IsRequired property.
The only way that I know of to set a class property read only is to not give it a setter.
I am trying to develop a tool which will add a host into the DNS server calling dnscmd.exe. I am assigning the property FileName as "dnscmd.exe" and pass the required i/p parameters. I did call nslookup.exe same way as I have called dnscmd.exe but in case of nslookup.exe code is working properly but in case of dnscmd.exe it's throwing exception while starting the process (here p.Start()) with message as "The system cannot find the file specified" .I am sharing the code snippet in top.
I have uncomment the WorkingDirectory and FileName (with fully qualified path of dnscmd) but still got the the same error. Someone please reply on my post and provide the resolution as I'll implement it ASAP. Thanks in advance
The above single line code works fine when we replace dnscmd to nslookup,ipconfig etc but when I am trying to run the single line code with dnscmd it opens a cmd window and showing "not recognized as an internal or external command" message but if I open a cmd window from run (not from c# programe) in the same computer (working fine from all directory) then dnscmd works fine and able to add dns entry also.
So, is there any possibility on access issue or anything else which causing abnormal behaviour of dnscmd. Please help!!!!
So pick out all the bits that add to the width of a column, multiply that by the number of columns in the data, add a bit and set your with to that. Run your app and when it looks horrible try and work out what you have missed. Get the max and min of your data range and that will help define your height.
Never underestimate the power of human stupidity
Hi, I want to create a windows phone 7.1 app for finding the closest postcode too 4 predefined postcodes, I have found an access db that has all the uk postcodes in so i thought I would start by with a simple postcode query and work from there but I am struggling to fidd a query tutorial that will go through query a database.
could someone point me in the right direction please,
It will depend on the geo coding of your source data. When I did something like this in about 2002 I found the postcodes in Britain change from 1 month to the next so there was a need to subscribe to one of the geo coding sources, was very expensive at the time.
Never underestimate the power of human stupidity
thanks for the reply, I am able to get the UK list for free from the post office at present so I would like to go down the database route for this exercise as I have not worked with databases before on windows mobile, I am struggling to find a simple user input query project to help me get started.
Please provide a sample code to execute multiple commands one by one and save output to same text file
That isn't how it works here.
We don't do homework, and we don't do your work for you either.
If you want code written for you to a specific specification, you have to pay - I suggest you go to VWorker.com and ask there.
But be aware: you get what you pay for. Pay peanuts, get monkeys.
If on the other hand you try to do it and get stuck, then feel free to ask for help with a specific problem and we will be glad to assist.
But we aren't going to do it all for you.
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
Hi i have implemented the same in vbscript . i was aware of the batch file concept but wanted to configure the commands in the code itself using Process class in C#.as i don't want it in batch .. thanks for your suggestion though.
Hi I am doing an exercise to change the content of a button 9windows app 7.1 VS2012)
I create the project and then its says
Drag a Button on to the Designer. See how it updates the Xaml with the Button tag. Selecting items in the Document Outline Window allows you to navigate the Xaml tree and it selects the item visually as well as in the Xaml. It is a handy way to navigate complex Xaml if not all of the Xaml is visable.
Select the Button go to the properties Window - this also creates events.
You can edit the control in the Properties Window or hand-edit the Xaml. To create an event you can either use the properties window or edit the Xaml.
To do this go to the Xaml for MainPage.xaml and find the Button that was added. Type Click= and then tab to create the event handler. This has been added in the code-behind .cs file. Type Button1.Content = “Hello World!”
I have done what it has say and my MainPage.xaml.cs looks like this:
public partial class MainPage : PhoneApplicationPage
private void Button_Click_1(object sender, RoutedEventArgs e)
Button.Content = "Hello World";
the 'Button.Content' produces this error:
Error 1 An object reference is required for the non-static field, method, or property
My MainPaipe.zaml has the following code in but no errors
<!--LayoutRoot is the root grid where all page content is placed-->
<!--TitlePanel contains the name of the application and page title-->
<!--ContentPanel - place additional content here-->
<Button Content="Button" HorizontalAlignment="Left" Height="79" Margin="142,53,0,0" VerticalAlignment="Top" Width="171" Click="Button_Click_1"/>
The problem comes because you are trying to use a variable called Button when there is no such variable. Just because you have defined a Button on the main page, it doesn't mean that the code behind knows about it. There are 2 ways to fix this (without going into doing this via MVVM). The first technique for doing this is to name your button in the XAML using
(this goes inside your Button declaration) and then use this name in your codebehind. The second way to do this is to take advantage of the fact that the sender argument refers to the control that set it, so you can do
Im working on a project for school, im suppose to make a console application which will show a Cinema system with 20 seats on 15 rows. I am very green on c# - so any help, Critism, or general thoughts are much appreciated!
I got a 2d array set up now, functionally and with space in between items so its not a mess to look at..
Im trying to take the program to the next level now, my program must show which seats are available, and which are taken,
and the program must let you book certain seats, and random seats.
I was thinking to make all the available seats green, and once you booked your seats they should go red -
How can i start doing this proberly?
I think im looking for background Color, and maybe If / else statements?
Here is how my program looks so far:
int[,] pladser = newint[,]
for (int x = 0; x < pladser.GetLength(0); x++)
for (int y = 0; y < pladser.GetLength(1); y++)
There must be a hundred ways in doing this. Just to give you an alternative of what you're doing.
The indexes of the array are already the row/seat number so there is no use in putting in a number in the array indicating this. Instead use a boolean. (true = taken, false = free)
Booking certain seats is then just like:
pladser[10, 12] = true; //booked row 11 seat 13.
For random assignment use the Random class with minimum = 0 and maximum the number of rows (or seats)
Some things to watch out for:
1. if a seat is taken you can't take it again. So take appropriate action.
2. Few people go alone to the movies and they want to sit next to one another if possible so in that case you end up checking multiple seats before assigning.
If you're working with a console application leave out the colors. You could use 'x' and 'o' for example.
Make sure in the output that it is clear to the user wat x, o or green/red mean.
for (Int32 index = 1; index < dtArray1.Count;index++)
if (dtArray1[index] >= dtArray1[index - 1])
dtArray1[index].Subtract(dtArray1[index - 1]);
/*Consider that i have list dtArray1 that consist of DateTime items I mean 10.10.2010, 10.10.2015 and so on. Could u say me how find subract of this element ? How i can get diffeerence between 2 years?
I think the problem is that you can't really explain the problem. If you can't explain the problem, this means you don't fully understand it. If I have a problem like this, I generally start off by breaking the problem down into things I know, and things I'm making as assumptions. By separating this list out, I tend to find I get a better understanding of what's actually being asked.
You keep showing code snippets with vague attempts at solutions, but this is leading us to make assumptions about what you are asking. You need to stop and present the real problem first - then, once you have worked this out, you would break it down further and start looking at code. For instance, you keep talking about years without intersection - but the examples you show effectively just look to work out the difference between the oldest and newest dates. The two things are not the same. Consider this example:
The dates that don't overlap are from 1995 to 1998 and 2004 to 2005. So, the total none overlapping years is actually 4 years. As you can see - your use of the term "years without intersection" adds confusion to the situation, so you really need to clarify this before we can continue.
no i understand my question but my problem is that i cant explain it ti your ,i want i find lenght of years
if there is overlap years i should delete one of them such as here
1998 2004 so for my question 2000 subtract 1995 and 2000-2003 is inside 1995-2005 so dont select it and also 1998-2004 inside in 1995-2005 i dont choose this years also so my totals years should be 2005-1995=10 my real question is that but how to do it i dont know
Don't start off by trying to think in code. Break the problem down using pen and paper. As a hint, you need to extract out the minimum start date and the maximum end date as a first step - only then can you start to remove the overlapping periods.
look at the value generated by the Subtract: it's not a DateTime, so you aren't using it.
Think about it: what do you get if you subtract one date from another? It can't be a date, because it doesn't have a reference point in time any more. It's a duration, or (in .NET speak) a TimeSpan.