Structures in VB.NET > C#.NET


I have a VB.NET code

Public Structure MyDates
    Dim _Title as String
    Dim _Date as DateTime
End Structure



temp = New MyDates()

 temp._Title = myDataReader.Item("Title")



I have written this using C#.NET.Here is the code


public struct MyDates
        string _Title;
        DateTime _Date;
        string _Type;




 MyDates temp = new MyDates();

        while (MyReader.Read())
            temp = new MyDates();


 * Check the BOLD one

when I type 'temp' and then press '.' it should be given me the properties ,such as _Title,_Date

Then it should be look like this

 while (MyReader.Read())
            temp = new MyDates();



 But when I press the '.' it is not given me those properties.What might be the reason for this.


Waiting 4 your answerSurprise 


3/31/2007 6:52:51 AM 93655 articles. 6 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 46
Get it on Google Play
Get it on Apple App Store

By default the protection level on fields in C# aren't public. So you need to add public before the field:

    public struct MyDates
        public string _Title;
        public DateTime _Date;
        public string _Type;


/Fredrik Normén - fredrikn @ twitter

Microsoft MVP, MCSD, MCAD, MCT

My Blog
3/31/2007 7:07:01 AM

Similar Artilces:

Sending SMS using or using or
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of develo...

converting to from offered me some sample code when I signed up with them the only problem is the sample code is in but my page that they type all of their credit card into is <code><%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.IO" %> <script language="C#" runat="server"> void Page_Load(Object Src, EventArgs E) { myPage.Text = readHtmlPage(""); } private String readHtmlPage(string url) { ... vs vs
just out of curiousity which looks, acts most like java? i'm still learning trying to used to but it seems that it was easier to do some stuff with java. C# is Java++ in my opinion. If you have done C or Jave you will prefer C#.Mike Schellenberger - MCAD If you are looking for language similar to java go for J#. However most code samples you find on the net will be in VB.NET and C#....

.Net 2.0 Web application using is unable to create object of another dll writen in C# .net 2.0
Hi, I habe created one web application using which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly. Should i have to deply any other files and if not what can be the solution for this? Please help. Thanks, So...

what lang does everyone prefer? Thanks, Peter Iuvara, MCP It's a very famous debatable question in forums! I would say if you are from Java/C/C++, then C# would be easy to use for you. If you are from ASP/VB, then VB.NET would be easy for you! As long as if you follow CLS, then what ever the language you use, it's going to be the same for CLR!Sreedharhttp://www.w3coder.orgweblog I would agree with that ... just curious as to what user's on this forum predominantly code in?Thanks, Peter Iuvara, MCP I came from no real programming background, started i...

VB.Net To C#.Net
Hello... Since Last from 1 year i had develope web application in using now i want to transfer from to so what should i do to transform to c# language any link or book related to me through i can easily understand and coding using c# in a short time... Thanks~ Mark As Answer If UseFull ~Kaushal. Hi, you can read the specifications of the language. You're already familiar with .NET and how to program in an OO manner thanks to your experience with The only thing you need to learn is the new syntax of C#. You can also convert parts of your v...

vb .net or c# .net
I currently develop websites using php but have been requested to develop a site using The question I have is for someone who knows php would it be better to transition to or Thanks, Fr. Robert C# -> There is a converter that will transition about 60% or more of your PHP code to C#. Plus C# is closer to PHP than VB.NET.Jason N. GaylordASPInsider and Microsoft MVP

Both C# ASPX pages and VB.NET ASPX in single VB.NET Web Applcation Template
Hi.. Is it possible to have both c# pages and VB pages in same Webapplication, what i chose is VB.NET Web application Template. With Thanks, Jaya.... I don't see why you couldn't, but for the sake of consistency I don't know why you would want to do this. When you choose a C# or VB.NET application template(I'm assuming you're using VS or WebMatrix), it simply creates a .aspx file that includes a page directive that specifies the page language. If you created a C# template but want to use VB.Net instead, you need to go from: <%@ Page Language="C#" .... to...

Converting from to
Hello I have recently purchased VBGolds RawDataPrinter which should allow users to print directly to label printers on our network directly from a c# web form.  Unfortunately they only supply examples and I have need of c#.  The component has been installed on our web server.  This is some code that they have supplied as examples in   "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns="" >"Head1" runat="server&qu...

Difference Between VB.Net And C#.Net
 hi friends,Please tell me the key difference between the Vb.Net And C#.Net..wheather supports operator overloading..Thanks & Regards,Pravin Kumar T.   Regards,Pravin Kumar T. pravin_thanusu:Please tell me the key difference between the Vb.Net And C#.Net.. Neither are ASP.NET so you probably want a different forum.  You'll also find your answers at JeffPlease: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.  >Please tell me the k...

How To Convert web template to Forms Template
I need  Convert web template to Forms Template   There are some free c# to vb converters out there which will allow you to upload a project and convert it to vb.   The programming models for windows forms and web projects are very different there is no way to convert a web to windows forms project.      Silverlight-helpVb TipsSpace Coast .Net User Group Hey Ajax-y, This tool really helps all programmers. I thought I would share this wit... and same app
Been asked before, but... If I build a c# web app and someone builds a desktop app, can they communicate? and can you develop against my c# web app, can I add the desktop app as a reference? or at least make calls to it? web apps or desktop apps can contain components created in either language. i have a web solution that contains 4 projects. One of the projects is C# the others are VB.Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: Thanks...that is what I was looking for ...

use of and
i make a small website using,  in it i make a 2 class in that i want to use in that website, i dont know how to call that class. let your class is  - class clsMyClass    {        public void myFunction()        {            // do something        }    } now the first way - create objectclsMyClass myObj = new clsMyClass();myObj.myFunction(); // call function================...

Web resources about - Structures in VB.NET > C#.NET -

Tree structure - Wikipedia, the free encyclopedia
A tree structure is a way of representing the hierarchical nature of a structure in a graphical form. It is named a "tree structure" because ...

Mosquito Hill fire: Structures lost as scrub burns on Fleurieu Peninsula - AdelaideNow Search Search
HOMES were threatened on Thursday as a bushfire raged through scrub on the Fleurieu Peninsula.

WA fires: Perth Hills fire downgraded, at least two structures destroyed
... eastern suburbs has been downgraded to an advice alert level after threatening lives and homes on Monday and destroying at least two structures. ...

COWI Strengthens Structure in North America
Three well-known specialized bridge, tunnel and marine engineering consultants have combined to drive the growth of COWI in North America. Effective ...

Listeners Project films pay homage to abandoned U.K. structures - Videos - CBS News
A most unusual film series is unfolding in Britain called The Listeners Project. It allows young filmmakers to record the last moments of architectural ...

In-house or outsourced? A key chart from our Organisational Structure guide
... a PPC specialist'? How have your marketing teams changed and upskilled in the past two years? Econsultancy's updated Organisational Structures ...

Barcelona's Foresight May Usurp Real Madrid as La Liga Moves Towards EPL Structure
BARCELONA, SPAIN - JANUARY 09: Neymar Santos Jr of FC Barcelona controls the ball during the La Liga match between FC Barcelona and Granada CF ...

These Amazing Immersive Models Help Scientists Understand the Structure of Forests
Tropical forest are large, complex and easy to get lost in—which isn’t helpful if you’re trying to study them. Now, scientists are using these ...

‘Fallout 4’ Underwater Structure Found, Could This Mean DLC Aquatic Adventures?
... — Han (@HanCilliers) December 2, 2015 The game is riddled with discoveries, and this one appeared to be some kind of pump structure of sorts ...

Marketing Day: Twitter Tests Timeline Structure, New Messaging Tools For Facebook Pages & More
Here's our recap of what happened in online marketing today, as reported on Marketing Land and other places across the web. Please visit Marketing ...

Resources last updated: 1/10/2016 7:23:44 AM