Get many values in a variable from database.
-
I have a function to display a popup in a form: taskbarNotifier1.Show("HostName: \n\n SiteHit: \n\n Survey: \n\n TAF: \n\n ATO: ", strQuery, 300, 2000, 300); Now these hostname,survey,taf,ato i have to get from database : strQuery = "select url,sitehit,survey,tellafriend,addtooutlook from tblsummary where datetime = now"; i.e. the last/current entry of database and store all these data in string 'strQuery' and call this variable 'strQuery' in above function taskbarNotifier1.Show in different lines ie one after other like this : |------------------------------------ | Hostname : nekshan@yahoo.com | | | Sitehit : 1 | | Survey : 0 | | tellafriend : 1 |_______________________________| These in bold are data to be displayed by the query. How to get all this data in one variable to put it in my function n display data in this format. Can i get many fields from a record of a table and store it in a variable or i have to use some other way. i dont know whether i can get many fields from a record of a table and store it in a variable. Hope to get some response. thank you nekshan. Hope u r getting my Point. Thanx nekshan.
-
I have a function to display a popup in a form: taskbarNotifier1.Show("HostName: \n\n SiteHit: \n\n Survey: \n\n TAF: \n\n ATO: ", strQuery, 300, 2000, 300); Now these hostname,survey,taf,ato i have to get from database : strQuery = "select url,sitehit,survey,tellafriend,addtooutlook from tblsummary where datetime = now"; i.e. the last/current entry of database and store all these data in string 'strQuery' and call this variable 'strQuery' in above function taskbarNotifier1.Show in different lines ie one after other like this : |------------------------------------ | Hostname : nekshan@yahoo.com | | | Sitehit : 1 | | Survey : 0 | | tellafriend : 1 |_______________________________| These in bold are data to be displayed by the query. How to get all this data in one variable to put it in my function n display data in this format. Can i get many fields from a record of a table and store it in a variable or i have to use some other way. i dont know whether i can get many fields from a record of a table and store it in a variable. Hope to get some response. thank you nekshan. Hope u r getting my Point. Thanx nekshan.
Hi, 1. For concatenating Strings, use StringBuilder. Append data in a StringBuilder variable. 2. For retrieve data from the database. a.Connect to database b.Fill data in Dataset using SQL Adapter or ExecuteDataSet. c.Save this result in a Dataset variable. (Assume variable as 'ds') 3. To get value of each column ---> ds.Tables[0].Rows[0]["url"].ToString() and so on for other columns.. 4. Append those values in a StringBuilder variable. 5. Use that variable in this line (Note : Replace strQuery -> StringBuilder variable) taskbarNotifier1.Show("HostName: \n\n SiteHit: \n\n Survey: \n\n TAF: \n\n ATO: ", SB, 300, 2000, 300); Hope this is what you wanted. -Harini
-
I have a function to display a popup in a form: taskbarNotifier1.Show("HostName: \n\n SiteHit: \n\n Survey: \n\n TAF: \n\n ATO: ", strQuery, 300, 2000, 300); Now these hostname,survey,taf,ato i have to get from database : strQuery = "select url,sitehit,survey,tellafriend,addtooutlook from tblsummary where datetime = now"; i.e. the last/current entry of database and store all these data in string 'strQuery' and call this variable 'strQuery' in above function taskbarNotifier1.Show in different lines ie one after other like this : |------------------------------------ | Hostname : nekshan@yahoo.com | | | Sitehit : 1 | | Survey : 0 | | tellafriend : 1 |_______________________________| These in bold are data to be displayed by the query. How to get all this data in one variable to put it in my function n display data in this format. Can i get many fields from a record of a table and store it in a variable or i have to use some other way. i dont know whether i can get many fields from a record of a table and store it in a variable. Hope to get some response. thank you nekshan. Hope u r getting my Point. Thanx nekshan.
i have soln but if u know how to create stored procedure then i send u ok. reply me u know or not.
-
i have soln but if u know how to create stored procedure then i send u ok. reply me u know or not.
Without stored procedure the solution won't work or what? No, I donno how to create storedprocedures. But i'll learn. Is it too complex or hard to learn? Today i m not feeling well, so i may work on it 2mrw, but u can send i'll study it, just explain in a bit detail. Thanx n Regards Nekshan.
-
Without stored procedure the solution won't work or what? No, I donno how to create storedprocedures. But i'll learn. Is it too complex or hard to learn? Today i m not feeling well, so i may work on it 2mrw, but u can send i'll study it, just explain in a bit detail. Thanx n Regards Nekshan.
' I ALLREADY SENT U THIS ANSWER WITHOUT STORED PROCEDURE IN ONE QUESTION REPLAY SO REFERE IT.OK.BYE.TC.
-
' I ALLREADY SENT U THIS ANSWER WITHOUT STORED PROCEDURE IN ONE QUESTION REPLAY SO REFERE IT.OK.BYE.TC.
hi!! Function can only return one value so if u want all three then u have to concat all in one variable like str = str1 + "#" + str2 + "#" + str3 then return str from function now on form u've to seperate all 3 from str by using mid(str,"#",1) like dis not exactly dis function is. u have to seperate like this all in different variable then use it. U r talking abt this answer? Y do i separate it using 'mid(str,"#",1)' on form? -- bcoz i have to display it one by one in a line?
-
hi!! Function can only return one value so if u want all three then u have to concat all in one variable like str = str1 + "#" + str2 + "#" + str3 then return str from function now on form u've to seperate all 3 from str by using mid(str,"#",1) like dis not exactly dis function is. u have to seperate like this all in different variable then use it. U r talking abt this answer? Y do i separate it using 'mid(str,"#",1)' on form? -- bcoz i have to display it one by one in a line?
' no i sent 1 fun which return dataset so use any variable directly as u like i think in prev question of this.on saturday.
-
' no i sent 1 fun which return dataset so use any variable directly as u like i think in prev question of this.on saturday.
U GET IN or i will send the code to seperate value from string. replay me.
-
U GET IN or i will send the code to seperate value from string. replay me.
-
I m not feeling well 2day, so i m going. I'll surely test it 2mrw. Thanx yar. Sorry! tari jode bou mehnat karau chu. Aje bau weaknes lageche.so... Bye thanx cu.tc. nekshan.
ok bye.tc