Wednesday, June 30, 2010

where to write & retrive connection string in window application ?

hi dear
the perfect place to write connection string in web application is web.config file and
in window application we can use the app.config for the application configuration
so add a app.config file to your project and add connection string section to your app.config file





after adding this to app.config file you need to retrive the connection string for the write code
is

sqlconnection =new sqlconnection(configurationmanager.connectionstrin["connectionstringname"].connectionstring);


but if u dont get configuration manger in your code then add system.configuration namespace to your file
but if u still not get the configuration manager then
add reference to your solution explorer for system.configuration and ur problem is solved


thanks

Friday, June 4, 2010

DR. Kumar Vishwash (Ek pagli ladki k bin )

Amawas ki kaali raaton mein dil ka darwaja khulta hai,
Jab dard ki pyaali raaton mein gum ansoon ke sang hote hain,
Jab pichwade ke kamre mein hum nipat akele hote hain,
Jab ghadiyan tik-tik chalti hain, sab sote hain, hum rote hain,
Jab baar baar dohrane se saari yaadein chuk jaati hain,
Jab unch-neech samjhane mein mathe ki nas dukh jaati hain,
Tab ek pagli ladki ke bin jeena gaddari lagta hai,
Aur us pagli ladki ke bin marna bhi bhari lagta hai.

Jab pothe khali hote hain, jab har sawali hote hain,
Jab gazlen raas nahin aatin, afsane gaali hote hain.
Jab baasi feeki dhoop sametein din jaldi dhal jaata hai,
Jab suraj ka laskhar chhat se galiyon mein der se jaata hai,
Jab jaldi ghar jaane ki ichha mann hi mann ghut jaati hai,
Jab college se ghar laane waali pahli bus chhut jaati hai,
Jab beman se khaana khaane par maa gussa ho jaati hai,
Jab lakh mana karne par bhi paaro padhne aa jaati hai,
Jab apna har manchaha kaam koi lachari lagta hai,
Tab ek pagli ladki ke bin jeena gaddari lagta hai,
Aur us pagli ladki ke bin marna bhi bhari lagta hai.

Jab kamre mein sannate ki awaj sunai deti hai,
Jab darpan mein aankhon ke neeche jhai dikhai deti hai,
Jab badki bhabhi kahti hain, kuchh sehat ka bhi dhyan karo,
Kya likhte ho dinbhar, kuchh sapnon ka bhi samman karo,
Jab baba waali baithak mein kuchh rishte waale aate hain,
Jab baba humein bulate hain, hum jaate hain, ghabrate hain,
Jab saari pahne ek ladki ka ek photo laya jaata hai,
Jab bhabhi humein manati hain, photo dikhlaya jaata hai,
Jab saare ghar ka samjhana humko fankari lagta hai,
Tab ek pagli ladki ke bin jeena gaddari lagta hai,
Aur us pagli ladki ke bin marna bhi bhari lagta hai.

Didi kahti hain us pagli ladki ki kuchh aukat nahin,
Uske dil mein bhaiya tere jaise pyare jasbat nahin,
Woh pagli ladki nau din mere liye bhooki rahti hai,
Chup-chup saare vrat karti hai, par mujhse kabhi na kahti hai,
Jo pagli ladki kahti hai, main pyar tumhi se karti hoon,
Lekin mein hoon majboor bahut, amma-baba se darti hoon,
Us pagli ladki par apna kuchh adhikar nahin baba,
Yeh katha-kahani kisse hain, kuchh bhi to saar nahin baba,
Bas us pagli ladki ke sang jeena fulwari lagta hai,
Aur us pagli ladki ke bhin marna bhi bhari lagta hai

~ Dr. Kumar Vishwas

Thursday, May 6, 2010

Array vs ArrayList

Array vs ArrayList

I've gotten this question a few times, so I thought it would make a good post. There's some confusion over the concept of an array versus an ArrayList class, and how to convert both into a LabVIEW array. So, let's start with what each actually is.

Arrays

As in other languages, an array is a high performance way of storing a group of data because each element is laid out next to it's neighbor in memory. This allows for very fast access because (a) the code can do a little math and jump quickly to any location in the array, and (b) the elements are all grouped together so they tend to be in memory at the same time (fewer page faults and cache misses).
An array in .NET is actually a class (System.Array), but a special type of class that is well understood by the .NET engine (CLR). Because of this, you can standard array access notation (text languages) such as
foo[3] = 99;

ArrayList

When it comes to an ArrayList, however, you are dealing with a collection. There are several types of collections in .NET (see the System.Collections and System.Collections.Specialized namespaces), but the key thing about them is the interfaces they support (IEnumerable, ICollections, IList, etc). If you look at the definition of these interfaces, you see that collections are all about grouping things together and providing methods to access them.
How do ArrayLists fit into this? Well, an ArrayList is simply a collection class - one that supports the IList interface - whose internal memory structure is an array. The keyword here, however, is internal. The ArrayList is not an array.
When would you choose to use an ArrayList over an array? There are several decisions factors that come into play when choosing how to pick your data structure, but a common reason people use ArrayLists is they don't know how big the array is going to get. If you create an array, you must say up front how large the array is going to be. Once picked, you can't change it.
With an ArrayList, however, if you add one element more than the internal array can handle, the ArrayList automatically creates a larger array and copies the old array into the new array. Again, this is all internal and you don't have to worry about it - other than performance considerations. Creating/destroying/copying arrays isn't something to do without thinking about your design.

LabVIEW

So what does this mean for you, the LabVIEW programmer? Well, the decision of which to use is a topic too large to cover here - it depends heavily on what your application is doing and how you are going to access/update your data (after all, there are dozens of other collections types besides ArrayList). But what if you already have one or the other?
Well, for arrays, no problem. LabVIEW knows all about arrays and will automatically covert a .NET array into a LV array, and vice versa.
But wait, you say, it doesn't in my program! Well, it does. When I've been told that LV isn't converting a user's .NET array into a LV array, it turns out that what they actually have is an ArrayList. Thus this post. [Actually, another time LV can't covert the array is when the reference is to the base System.Array class rather than the classic typed array such as int[10]. In this case, we can't tell at compile time what type of data the array contains and so we are stuck]
The main advantage to an ArrayList collection is that it supports a handy little method called ToArray(). This method creates a copy of the internal array and returns it to you, allowing you to create a LV array. This is much faster than creating a LV array by looping through the ArrayList yourself inside LabVIEW.

Monday, May 3, 2010

how to read connection string from app.config file in window application

how to read connection string from app.config file in window application

there is a requirement that we need to read some key values in our window application from app config file
for example we need to read connection string from app config file


this is our app.config file






connectionString="Data Source=localhost;Initial Catalog=database name;User ID=sa;Password=123456"
providerName="System.Data.SqlClient" />






so for read this we have to make a method



public string connection()
{
return System.Configuration.ConfigurationManager.ConnectionStrings["pollsConnectionString"].ToString();
}




but in this you might get error is that ConfigurationManager doesnt exists in this context
so remove this simply add system.configuration namespace
but if error still exists add reference of configuration manager

Wednesday, April 7, 2010

how to use java script in asp.net page

The names of the controls inside a usercontrol get renamed when they're rendered on the page (rt click & ViewSource to see it) so you need to code the field name. You can do this:



var vdp = document.getElementById('<%= dp.ClientID %>');


alert(vdp.value);

Saturday, April 3, 2010

Register Java Script with ajax on asp.net page

hi dear
there is a problem which we find when we r using javascript on any page which already use ajax .
we have to register our javascript code with asp.net


but if u still facing error of http request then
place all script and tags which are using <% %> in to asp:placeholder id="" runat="server" scripts asp:placeholder


it will solve ur problem thanks

ASP.NET Core

 Certainly! Here are 10 advanced .NET Core interview questions covering various topics: 1. **ASP.NET Core Middleware Pipeline**: Explain the...