jojodog jojodog - 5 months ago 15
Vb.net Question

How to combine value in datagridview table with custom

this my datagridview2, from contact.db that have 2 coloum : no_tlp (telephone number), and Contact name

and this is my datagridview1, from sms.db that have 3 coloum : id_thread, address (phone no),body(sms text)

i want to combine both datagridview so they can show; id_thread, contact name, and body sms, then throw to datagridview3

but i have problem that phone number in datagridview1 & datagridview2 have different value like +62 and 0 (country code),

i have plan to change all 0 on phone number to +62, and combine both where phone_no in contact = phone_no in sms

can someone help me?

Answer

for change the php number you can

update contact
set no_tlp = concat('+62', right(no_tlp, length(no_tlp) -1))
where no_tlp like '0%';

once you ha update the n_tlp you can select from both the table

 select contact.*, sms.*
 from contact 
 inner join sms on contact.n_tlp = sms.address
Comments