Friday, September 3, 2010
how to create ms acess database at runtime for seprate finance year
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ADOX; (for this u have to add refrence)
private void button1_Click(object sender, EventArgs e)
{
try
{
CatalogClass cat = new CatalogClass();
string tmpStr;
string filename = txtStartingYear.Text + "-" + txtEndingYear.Text;
tmpStr = "Provider=Microsoft.Jet.OLEDB.4.0;";
tmpStr += "Data Source= C:\\" + filename+".mdb" + ";Jet OLEDB:Engine Type=5";
cat.Create(tmpStr);
Table nTable = new Table();
nTable.Name = "PersonData";
nTable.Columns.Append("LastName", DataTypeEnum.adVarWChar, 25);
nTable.Columns.Append("FirstName", DataTypeEnum.adVarWChar, 25);
nTable.Columns.Append("Address 1", DataTypeEnum.adVarWChar, 45);
nTable.Columns.Append("Address 2", DataTypeEnum.adVarWChar, 45);
nTable.Columns.Append("City", DataTypeEnum.adVarWChar, 25);
nTable.Columns.Append("State", DataTypeEnum.adVarWChar, 2);
nTable.Columns.Append("Zip", DataTypeEnum.adVarWChar, 9);
cat.Tables.Append(nTable);
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(nTable);
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(cat.Tables);
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(cat.ActiveConnection);
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(cat);
}
catch (Exception ex)
{
MessageBox.Show("Database with this name already exists");
}
}
Saturday, August 21, 2010
when executing a sql file getting "system.outofmemoryexception" in sql server 2005
today i m face a very interesting problem is that in our erp system we gnerate .sql file from database publishing wizard and server genrate .sql file successfully . but when i am execute that file on our local system in sql server 2005 we will get error that "system.outofmemoryexception" .i google it and found the solution that this problem is related to sql server memory configuration
. actually default setting of sql server use 2 gb memory for executing the any query in database sql server 2005
then there is two option
1-first one is suggested by msdn is that expand your memory from 2gb to 3 gb
2- second which i try and got success which is dont execute query at once , divide ur query in bunch of some lines so you can execute them.and after one by one execute all bunch of sql queries
i know that my solution is temporary but its work for me..
Friday, August 20, 2010
how to Show HTML/JavaScript Code inside Blogger Blog Posts on your blog
"The Blogspot’s XML parser takes it as a code, and shows the result whatever is written in the code you pasted… Its only you who knows that you wanted to show the code deliberately without wanting it to be parsed automatically ."
so now as always solution in problem it self . so in this our problem the solution is that our code should not be parsed automatically for this ...........
Google’s Blogger Team realized this, and have added a solution for this in Blogger’s settings.
1. Login to your blogger account
2. Go to Settings.
3. Go down to the page.
4. Under “Select Post Editor”, choose “Updated Editor”.
5. Save the Settings.
after this setting for a new post which have code use following
Now Go and make a post, click “Post Options” below the post editor, and select “show HTML Literally”.
Insert any HTML codes in the post and preview or publish it.
how to Change the Authentication Mode of the SQL server 2005 from "Windows Authentication Mode (Windows Authentication)" to "Mixed Mode (Windows Au
today i face a problem that is at the time of installation of slq server 2005 i have choosen window authentication except
Mixed Mode (Windows Authentication and SQL Server Authentication)", and now i want to change it because when i create any new
login and try to connect with the new login credentials it will show error that "user is not associated with trusted sql
server connection" and this error due to i have choosen window authentication . so i have to change this mode in sql server.
for this it is simple connect ur server with window aunthetication and right click on server name in object explorer and
choose properties -> a window will open and in side pane choose security page there is a option to change mode , now press ok
now u can login with sql server authentication mode.
Wednesday, August 18, 2010
how to set default browser ?
account in internet explorer , but i want that it should open in mozilla firefox, the problem is understandable that mozilla
is currently not my default browser ? then i how can set it default browser ?
i google on this topic and find solution on mozilla website that you can go throught tools menu and choos options and in
option dialog box choose advanced tab there is a subtab general at first no my there is option to check default browser and
if u press it then it will ask to set mozilla set as default so u can make mozilla firefox as default browser from here .
but the problem is still that if i want to set any other browser so i need a solution from which i can set any browser as
default browser.
and problem solution exists in window settings that is sure. and finally i got the solution that is go to your control
panel and in add or remove programs there is a option for "set program access and defualts" in side bar of dialog box where u can find the set the default for any program u want . there u can set any browser as your default browser......
Monday, August 16, 2010
keyboard with new rupees sign
after launching new rupee sign by govt. of india the keyboard which have new rupee sign is launched , the details information is avaliable on below link
http://www.techtree.com/India/News/First_Keyboard_with_the_New_Rupee_Sign_Arrives/551-112580-581.html
Monday, August 9, 2010
Deciding When to Create an MVC Application
Before you decide to use the MVC framework or the Web Forms model for a specific Web site, weigh the advantages of each approach.
Advantages of an MVC-Based Web Application
The ASP.NET MVC framework offers the following advantages:
* It makes it easier to manage complexity by dividing an application into the model, the view, and the controller.
* It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application.
* It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure. For more information, see Front Controller on the MSDN Web site.
* It provides better support for test-driven development (TDD).
* It works well for Web applications that are supported by large teams of developers and Web designers who need a high degree of control over the application behavior.
Advantages of a Web Forms-Based Web Application
The Web Forms-based framework offers the following advantages:
* It supports an event model that preserves state over HTTP, which benefits line-of-business Web application development. The Web Forms-based application provides dozens of events that are supported in hundreds of server controls.
* It uses a Page Controller pattern that adds functionality to individual pages. For more information, see Page Controller on the MSDN Web site.
* It uses view state or server-based forms, which can make managing state information easier.
* It works well for small teams of Web developers and designers who want to take advantage of the large number of components available for rapid application development.
* In general, it is less complex for application development, because the components (the Page class, controls, and so on) are tightly integrated and usually require less code than the MVC model.
Saturday, July 24, 2010
how can i fill dataset values to javascript two diamentional array?
Try this:
Server-side code:
// Create the DataSet here:
DataSet yourDataSet = new DataSet();
System.Text.StringBuilder javaScript = new System.Text.StringBuilder();
DataTable dataTable = yourDataSet.Tables[0];
for (int i=0; i
if (i == 0)
{
javaScript.Append("var yourArray = \n[\n");
}
DataRow dataRow = dataTable.Rows[i];
for (int j=0; j
if (j == 0)
javaScript.Append(" [ ");
javaScript.Append("'" + dataRow[j].ToString().Trim() + "'");
if ((j + 1) == dataRow.Table.Columns.Count)
javaScript.Append(" ]");
else
javaScript.Append(",");
}
if ((i + 1) == dataTable.Rows.Count)
{
javaScript.Append("\n];\n");
}
else
{
javaScript.Append(",\n");
}
}
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "ArrayScript", javaScript.ToString(), true);
Client-side code to test with:
Wednesday, June 30, 2010
where to write & retrive connection string in window application ?
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
ArrayList
LabVIEW
Tuesday, May 4, 2010
Women are never wrong. Apologizing is the man’s responsibility.
Monday, May 3, 2010
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
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
var vdp = document.getElementById('<%= dp.ClientID %>');
alert(vdp.value);
Saturday, April 3, 2010
Register Java Script with ajax on asp.net page
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
Tuesday, March 30, 2010
Mail i received abt love story
*A TRUE STORY - VERY SHOCKING*
*Very Shocking.....*
This is a real story of a young college girl who passed away last month in
Chandigarh.
Her name was Priya. She was hit by a truck.
She was working in a call center. She had a boy friend named Shankar.
Both of them were true lovers. They always talked on the phone.
You would never found her without handphone. In fact she also changed her
cell connection from Airtel to Hutch, so that both of them can be on the
same network, and save on the cost.
She used to spend half of the day talking with shankar.
Priya's family knew about their relationship. . Shankar was very close to
Priya's family as well. (Just imagine their love) .
Before she passed away she always told her friends 'If I pass away please
burn me with my handphone' she also said the same thing to her parents.
After her death, people cudnt carry her body, A lot of them tried to do
so,but still cant. Everybody had tried to carry the body, the results were
the same.
Eventually, they called a person known to one of their neighbours, who can
speak with the soul of dead person and who was a friend of her father.
He took a stick and started speaking to himself slowly.
After a few minutes, he said 'this girl misses something here.' Then her
friends told that person about her intentions to burn her with her phone.
He then opened the grave box and place her phone and sim card inside the
casket. After that they tried to carry the body. It was then moved easily
and they then carried her into the van.
All of us were shocked. Priya's parents did not inform Shankar that Priya
had passed away..
After 2 weeks Shankar called Priya's mom.....
Shankar :.....'Aunty, I'm coming home today. Cook something nice for me.
Don't tell Priya that I'm coming home today, I wanna surprise her.'
Her mother replied..... 'You come home first, I wanna tell you something
very important.'
After he came, they told him the truth about Priya.
Shankar thinks that they were playing a fool. He was laughing and said
'don't try to fool me - tell Priya to come out, i have a gift for her.
Please stop this nonsense'.
Then they show him the original death certificate to him.
They gave him proof to make him believe. (Shankar started to sweat) He
said... 'Its not true. We spoke yesterday.. She still calls me.
Shankar was shaking.
Suddenly, Shankar's phone rang. 'see this is from Priya, see this....' he
showed the phone to priya's family. all of them told him to answer. he
talked using the loudspeaker mode.
All of them heard his conversation.
Loud and clear, no cross lines, no humming.
It is the actual voice of Priya & there is no way others could use her sim
card since it is nailed inside the grave box
They were so shocked and asked for the same person's
(who can speak with the soul of deal persons) help again. He brought his
master to solve this matter.
He & his master
worked for 5 hours.
Then they discovered one thing which really shocked them....
*Vodafone has the best coverage *
*'Where ever you go, our network follows!!!'*
*So what you can do...you should also forward this mail to all your nears
and dears...and enjoy...like i enjoyed*
*HA HA HA HA HA........*
India Inc.'s tryst with Twitter
Says Aditya Swamy, Senior VP, Sales and Marketing, MTV India (which was the most followed brand on Twitter, according to the study): "In eight to 10 months of joining Twitter, over 60,000 followers have been helping MTV gauge the pulse of its audiences." And the road ahead?
According to the Iffort study: "More companies will start using Twitter for conducting market research, listening to users and keeping track of the competition."
Twitter Facts
Most active account: MSN India
Most conversational brand: ICICI Bank
Most Re-Tweeted brand: Tata Docomo
Oldest brand: Bookmyshow.com
Top inactive brand: Acer India & Apollo Hospitals
www.junnon-waqt.blogspot.com
Thursday, March 25, 2010
Delete All Stored Procedures and Tables from a single Query
some time we in need to delete all stored procedures and tables from database
so for that we need a single query which do the all the work. below is the query once u run both query all tables and stored procedure of that database is drooped.
but carefully because once you dropped u cant get them back--
----------drop all tables from database-----------
exec sp_MSforeachtable "DROP TABLE ? PRINT '? to be dropped' "
------------drop all sp's in a database---------------
DECLARE @procedureName varchar(500)
DECLARE cur CURSOR
FOR SELECT [name] FROM sys.objects WHERE type = 'p'
OPEN cur
FETCH NEXT FROM cur INTO @procedureName
WHILE @@fetch_status = 0
BEGIN
EXEC('DROP PROCEDURE ' + @procedureName)
FETCH NEXT FROM cur INTO @procedureName
END
CLOSE cur
DEALLOCATE cur
this works i have tested it several time with MS sql server 2005
Wednesday, March 24, 2010
ERP
but one thing is clear in my mind that any erp for any industry its fits on the below definition .
Enterprise resource planning (ERP) is an integrated computer-based system used to manage internal and external resources including tangible assets, financial resources, materials, and human resources. It is a software architecture whose purpose is to facilitate the flow of information between all business functions inside the boundaries of the organization and manage the connections to outside stakeholders. Built on a centralized database and normally utilizing a common computing platform, ERP systems consolidate all business operations into a uniform and enterprise wide system environment.
An ERP system can either reside on a centralized server or be distributed across modular hardware and software units that provide "services" and communicate on a local area network. The distributed design allows a business to assemble modules from different vendors without the need for the placement of multiple copies of complex, expensive computer systems in areas which will not use their full capacity
above definition taken from Wikipedia .
what a industry gets from an erp
i think the erp does not increase your profit but it saves your business from small size losses ,which are not countable individually but make huge difference in collective manner.
Tuesday, March 23, 2010
My first blog
i asked gajanan abt bolgging one of my new friend who is the active blogger .he said write anything "ulta-pulta ".
so finally all of u prepare for the read some "ulta-pulta",
ASP.NET Core
Certainly! Here are 10 advanced .NET Core interview questions covering various topics: 1. **ASP.NET Core Middleware Pipeline**: Explain the...
-
The error message you encountered ("DeleteService FAILED 1072: The specified service has been marked for deletion") indicates tha...
-
replace html of a div using jquery this is simple . just use .html() method of jquery to set new html for a div . $ ( "#divID...
-
declare @ProductIds nvarchar(50)='18,19' SELECT * FROM products Where (',' + @ProductIds +',' LIKE '%,' ...