Friday, 11 May 2012

SQL Query.

For copying content  between 2 tables which have dissimilar columns, I used

INSERT [INTO] tablename1 (field1, field2, field3, field4)
SELECT field1, field2, field3, A_VALUE dummy_field
FROM tablename2

eg:

insert into Jewel_Details(particular,Nos,Grosswt,Netwt,Remarks,Loan_ID,Cus_ID, Cus_Name) 
select particular,Nos,Grosswt,Netwt,Remarks, '1' as Loan_ID, '2' as Cus_ID,'hai' as Cus_Name from temp;
 

Sunday, 15 April 2012

Unbinding a control

I tried to unbind a combobox with code

ComboBox2.DataSource = "".

 But It failed by saying error similar to complex databinding. Then I did it with

ComboBox2.DataSource = vbNullString


so experienced to have more stuff in basics....



Saturday, 24 March 2012

Dynamically passing table name in select query in vb.net

Today I tried to pass table name dynamically to select query  as

 cmd = New OdbcCommand ("select * from '" & table_name & "' where id=" & i & "", con)
But it failed. Then fortunately got the correct one....

cmd = New OdbcCommand("select * from [" & table_name & "] where id=" & i & "", con)

Similarly avoid single quotes while using number.
eg: use  id=" & i & "  instead  id=' " & i & " ' ,when id is number type. 

Thursday, 22 March 2012

Happy to Work.

Really I'm very happy to work while studying. Gained lot of knowledge from my company. Its very interesting to face multiple goals concurrently. Night works, new goals, targets, new technologies, compact tools more than this a good friendly environment. Becoming crazy to code. 

Thanks to vmtechsolutions

Thursday, 8 March 2012

Really I'm a dash...

Really I'm a stupid.... To remove a single error ("want to remove a single quotation ") utilized 4 days hardly...

Decided to clear basic concepts of technologies....