Click here to Skip to main content
15,886,422 members
Articles / Database Development / SQL Server
Article

LINQ Code generator

Rate me:
Please Sign up or sign in to vote.
2.12/5 (15 votes)
31 Dec 2007CPOL4 min read 35.5K   852   24   4
This generates Basic linq codes just by giving necessary inputs

Introduction

LINQ code generator is simple application which generates SQl based LINQ codes by taking some inputs. As LINQ is new to many developers This basic generator is used to generate and test basic Sql based LINQ codes in less than Minutes.

Background

as i started working on LINQ,I came to a very strong conclusion that LINQ has great future.But found it needs more changes still to be done by microsoft.

Using the code

The code usage for this is very simple We have category called LINQ here for it we have sub category LINQ with SQL under that sub category we have Insert Update Delete Select Selecting any option post backs page and give some text boxes to take some inputs just enter the required inputs now clik on generate code button code will be then generated copy code and paste it your application. with this generator forms like registration forms etc can be done simply in mins.we an also show results in grid.we can show results based on conditions etc., in order to not to deviate begineers confidence levels i tried to develop this generator with minimum options and left many more options for future.

Basic Bug to be fixed is change version from 2.0 to 3.5 in web.config before running beta.

                <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Data.DataSetExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
</compilation>

I used MS Access Database to develop Code. The final code generated need a dbml file. How to create dbml file : Create a sql database and tables in it. now add a new item , dbml file a new datacontext open design view of dbml file now drag and drop your sql database tables to dbml design area its user friendly to make relations and all there it self. generated code need a dbml file in its default path.

I Used vb code to generate LINQ code. Requirements are being added to database table and retrieved while taking inputs to generate code.

Points of Interest

Working with VS2008 beta mad me mad fr nearly 7-10 days. donno y i got mad initially in many angles. i donno i should name the problems as bugs or suggessions but they made me really feel that "some thing has gone wrong with Microsoft " Some Pretty Things(I donno if i should call as bugs) i found to suggest

  • Initiall i started developing app. and run it . thats great version error. in web.config version number is not changing automatially.i opened web.config and changed version number to 3.5.how many developer can try to do this?
  • i am getting some problems on renaming files.all the parent and child files related to it are not adjusting according with renamed files immediately.
  • a big primary key problem. the scenario is like i developed some db , table in it, i had give first fild as primary key i was on application ..playing with it. .. now i changed primary key to table as some thing other than first field the problem now comes even i know the problem is data comes from only dataset and not from table again... this should be reflected immediately to dataset after changes to db.
  • data context location problem.if path of dataconxt is changed the intellisense problem occurs.
  • i found some problems while inserting/editing to msaccess database using controls like formview.
  • if i use some user control and if i like to delete it from design part some lines of user control code remains there in code.
  • i cannot understand wjy microsoft is making weight of application still more and more and more....the application loading etc are terrificly slow for not a very high level confugaration system users
  • intellisense is needed in more locations like between double quotes(Not at all kidding) also.The intellisense part in code behind is more wen compared to design part.
  • backward intellisense is also needed like response.write and now if we write as write then we should get response to its front.This is not kidding i am stating this after working in differrent angles on intellisense.
  • the main and main thing is microsoft should make application smoother ,less weighter and faster.

    History

    Even this code developer is simple smart application for confidence building. i came across all Linq Applications and found the advantages of using LINQ.

  • License

    This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


    Written By
    Web Developer
    India India
    Work Makes me Work More

    Comments and Discussions

     
    GeneralMy vote of 2 Pin
    Bhavikgoyal15-Feb-11 18:10
    Bhavikgoyal15-Feb-11 18:10 
    Generalexcellent one Pin
    ursdpt1-Jan-08 3:16
    ursdpt1-Jan-08 3:16 
    GeneralRe: excellent one Pin
    Mufaka1-Jan-08 7:52
    Mufaka1-Jan-08 7:52 
    GeneralRe: excellent one Pin
    Sree Nivas1-Jan-08 17:11
    Sree Nivas1-Jan-08 17:11 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.