|
It is a pretty simple conversion in this case:
var field1s =
from t in yourDataContext.testtable
where t.column1 == "customer" &&
t.column2 == "statename"
select t.field1;
The field1s will be of type IQueryable<ftype> where ftype represents the data type of field1 .
|
|
|
|
|
There will be times when no data is returned, null value. How would I code for that?
|
|
|
|
|
"no data is returned" and "null value" are not the same thing. A query returning no results is fine, the result of the Linq expression will be an IQueryable that when iterated over runs the iteration 0 times.
|
|
|
|
|
Hello,
I am Binding a ajax accordion dynamically,
I am using <HeaderTemplate><HeaderTemplate> and
<ContentTemplate>></ContentTemplate> to bind a data
in contenttemplate i am using datalist, Itemtemplate.
On Development side the accordion application is working fine. but same application giving problem on production server accordion section is coming blank.
I checked at both environment production and development by using firebug. on production environment the code for accordion not getting executed also there is no problem in storeprocedure.
Please help me what problem may there.. because coding and database are fine in development but at production not getting what issues are there may be... !!!!
Thanks & Regards,
Pallavii
|
|
|
|
|
|
Can someone help understand how to write code in c# 2010. I am currently taking a c# course but I'm not grasping all the concepts. This is the 2 week and I'm lost. I'm reading the material but it is not sticking.
Example: using the console IDE only, must be able to create a grade tabulation app The grades must be entered from the cdrm prompt allowing for to decimal places. Catagories are 10 homeworks, 5 projects, 1 midterm and 1 final. Can someone provide me with the code for this app in c# 2010.
|
|
|
|
|
Sure buddy - head over to the Homework thread and post the question there. The guys modding that thread are experts in homework assignments! There might be a small fee involved, but hell, it makes you life easier by not having to go through the pain of putting in effort and time in your studies!
|
|
|
|
|
|
|
|
Voted 1 for the 'gimme codez' aspect. We're not here to make you artificially pass a course that you aren't competent in.
Most courses are well graded and it's hard to suggest a better place to start than your course. Is it a school/university course with lectures and real people giving it? If so, if there are small parts that you don't get, you may need to ask your teacher/lecturer or class to explain it in a different way until it goes in. If it's a self-taught course from a book or online, take it slowly, practice each step until you really get it, and then move on to the next one.
Reading the material is never enough, you need to practice doing as well. Most courses have exercises every chapter, and if you want to learn, you will want to do those.
|
|
|
|
|
How to solve your problem: Baby steps.
As you can see, it's too hard for you to do all at once, but breaking it down into simpler steps that are more manageable will enable you to do it. (I'm a professional programmer, and this approach works for me when I'm faced with a task that's too hard to do all at once.)
The first step is to get a program running. C programmers start with a program that simply prints "Hello world." on the console, and this would be a good first step for you. It requires you to be able to edit a file to add the code, and compile and run it. You'll have to look up the statement that outputs text to the console. (Looking it up is good practice, because this is how you acquire programming knowledge you don't already have. We all do it.)
The next step is accepting input from the command prompt. (More lookup.) Don't be afraid to experiment! This is an important way of learning what works and what doesn't.
The next step is getting the input into numeric variables you can use to calculate grades.
If you think your program is behaving incomprehensibly, use what you learned in the first step to print out the values of some variables to see what's REALLY happening as your program executes. (Later you'll learn how to use the debugger to do this. The debugger will save you HOURS of guesswork -- learn it.)
Baby steps. Good luck!
"Microsoft -- Adding unnecessary complexity to your work since 1987!"
|
|
|
|
|
Quit, re-enrol in an arts class.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Its best that you try something - write some code and then post questions related to that code here.
This will help you learn faster.
|
|
|
|
|
Help I don't know what I'm doing wrong.
the below code is in my form but I am getting
the results below from textBox3.Text = Convert.ToString(Dns.GetHostEntry("google.com"));
what returns into the textbox is System.Net.IPHostEntry
i try textBox3.Text = Convert.ToString(Dns.GetHostAddresses("google.com")); and i get System.Net.IPAddress[] in the textbox I tried a new project doing the same things and its still giving me this, IDE is VS2010 Visual C#
using System;
using System.Net;
using System.Net.Sockets;
using System.Web;
using System.Net.NetworkInformation;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
private void Login_Load(object sender, EventArgs e)
{
m_ChildForm = new MainChat(this);
textBox3.Text = Convert.ToString(Dns.GetHostAddresses("www.google.com"));
}
modified 6-Jun-12 20:41pm.
|
|
|
|
|
Convert doesn't know how to make an IP address into a string, but System.Net.IPAddress knows how to turn itself into a string.
textBox3.Text = Dns.GetHostAddresses("www.google.com").ToString;
Ain't Google/MSDN wonderful?
Peter
[edit] Didn't notice the plural addresses. You'll need to wrap a loop around it... [/edit]
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
The result i get in te textbox from that is
System.Net.IPAddress[]
someone suggested that I put in
Dns.GetHostEntry("google.com").HostName
the result from that was 'google.com' in the textbox
nothing is working... I tried a new console app project and i get same result
but when i do a powershell i get the result below, but not in my application. PLEASE HELP!
[System.Net.Dns]::GetHostAddresses("google.com")
Address : 2575508806
AddressFamily : InterNetwork
ScopeId :
IsIPv6Multicast : False
IsIPv6LinkLocal : False
IsIPv6SiteLocal : False
IPAddressToString : 70.37.131.153
modified 6-Jun-12 23:16pm.
|
|
|
|
|
After a bunch of tries i figured it out, it wouldn't let me convert IPAddress[] to IPAddress so then i figured its an array so let me just imply the index 0 to see whats in it. the code below works
IPAddress[] blah = Dns.GetHostAddresses("google.com");
System.Console.WriteLine(blah[0]);
|
|
|
|
|
Member 893460 wrote: it wouldn't let me convert IPAddress[] to IPAddress
Which is quite normal; how would you expect it to convert an array of objects into a single object?
|
|
|
|
|
When I said "wrap a loop around it" I meant something like
IPAddress[] adrslist = Dns.GetHostAddresses("www.google.com");
foreach System.Net.IPAddress ipadrs in adrslist {
.... = ipadrs.ToString;
}
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
thanks for that solution as well. I this would be great for something that requires you to obtain all the ip addresses, I just needed one for a textbox
|
|
|
|
|
mọi người giúp dùm mình vs
|
|
|
|
|
Google translate thinks that is Vietnamese:
"need help moving vehicle code
help his people vs Corner"
I'm sure English is not your native language, but it is the default language for this site.
In English, your question makes no sense at all.
Please, either try to find a better translation of your question to English, or find a site in your own native language, as they may be able to help you better than we can!
Use the "Improve question" widget to edit your question and provide better information.
Tôi chắc chắn rằng tiếng Anh không phải ngôn ngữ mẹ đẻ của bạn, nhưng nó là ngôn ngữ mặc định cho trang web này.Trong tiếng Anh, câu hỏi của bạn làm cho không có ý nghĩa ở tất cả.Xin vui lòng, hoặc cố gắng để tìm một bản dịch tốt hơn của câu hỏi của bạn sang tiếng Anh, hoặc tìm một trang web bằng ngôn ngữ mẹ đẻ của bạn, vì họ có thể có thể giúp bạn tốt hơn so với chúng ta có thể!Sử dụng "Improve question" phụ tùng để sửa câu hỏi của bạn và cung cấp thông tin tốt hơn.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Sorry but posting this question in a language other than english has narrowed down those who can answer your question by a great deal.
|
|
|
|
|