Log in
BSU INFO-TECH
FB COMMENT
vb.net long sql command
3 posters
Page 1 of 1
vb.net long sql command
Help paano ba pabababain ang pagkahaba habang sql command sa vb.net para di mgscroll ng pagkahababa to the right
Re: vb.net long sql command
ung parang sa C sana na pwedi mo isingit ang code na \n for new line,para bababa yung ibang codes.
Re: vb.net long sql command
do you mean sa output nga query or yung query mismo....
If the query itself,. I think sql commands ignores white spaces kaya just press enter
ex.
SELECT
userName, Password
FROM
tblAccounts
WHERE
userID = '143';
If the query itself,. I think sql commands ignores white spaces kaya just press enter
ex.
SELECT
userName, Password
FROM
tblAccounts
WHERE
userID = '143';
Lyt_Grey- Admin
-
Number of posts : 308
Age : 36
Location : La Trinidad, Benguet
Job/hobbies : Ado ngem basit lang
Reputation : 0
Registration date : 2008-12-04
Re: vb.net long sql command
jay kastoy ngay nga code,dba no vb.net ket atidog dayta,ket kailangan nga ag scroll to the right no ada e edit or kitam jay code
cmd.CommandText = "SELECT sum_Abra.indicators AS INDICATORS (sum_Abra.february+sum_Apayao.february+sum_Baguio.february+sum_Benguet.february+sum_Ifugao.february+sum_Kalinga.february+sum_MP.february)AS Total,(sum_Abra.feb_female+sum_Apayao.feb_female+sum_Baguio.feb_female+sum_Benguet.feb_female+sum_Ifugao.feb_female+sum_Kalinga.feb_female+sum_MP.feb_female)AS Female,(sum_Abra.march+sum_Apayao.march+sum_Baguio.march+sum_Benguet.march+sum_Ifugao.march+sum_Kalinga.march+sum_MP.march)AS Total2,(sum_Abra.mar_female+sum_Apayao.mar_female+sum_Baguio.mar_female+sum_Benguet.mar_female+sum_Ifugao.mar_female+sum_Kalinga.mar_female+sum_MP.mar_female)AS Female2,((sum_Abra.march+sum_Apayao.march+sum_Baguio.march+sum_Benguet.march+sum_Ifugao.march+sum_Kalinga.february+sum_MP.march)+(sum_Abra.februa
cmd.CommandText = "SELECT sum_Abra.indicators AS INDICATORS (sum_Abra.february+sum_Apayao.february+sum_Baguio.february+sum_Benguet.february+sum_Ifugao.february+sum_Kalinga.february+sum_MP.february)AS Total,(sum_Abra.feb_female+sum_Apayao.feb_female+sum_Baguio.feb_female+sum_Benguet.feb_female+sum_Ifugao.feb_female+sum_Kalinga.feb_female+sum_MP.feb_female)AS Female,(sum_Abra.march+sum_Apayao.march+sum_Baguio.march+sum_Benguet.march+sum_Ifugao.march+sum_Kalinga.march+sum_MP.march)AS Total2,(sum_Abra.mar_female+sum_Apayao.mar_female+sum_Baguio.mar_female+sum_Benguet.mar_female+sum_Ifugao.mar_female+sum_Kalinga.mar_female+sum_MP.mar_female)AS Female2,((sum_Abra.march+sum_Apayao.march+sum_Baguio.march+sum_Benguet.march+sum_Ifugao.march+sum_Kalinga.february+sum_MP.march)+(sum_Abra.februa
Re: vb.net long sql command
Have you tried using stored procedures or views
ex.
create a view for that query and name it view_INDICATORS
then your query in VB will just be
SELECT * FROM view_INDICATORS;
ex.
in MySQL ah
CREATE VIEW view_INDICATOR AS
SELECT blah, blah, blah, blah
FROM
table_BLAH;
Contents of View comes from the table and will automatically update itself
when the table source will be updated
stored procedure,.. i forgot na eh,.
hintayin natin post ni Raizel
ex.
create a view for that query and name it view_INDICATORS
then your query in VB will just be
SELECT * FROM view_INDICATORS;
ex.
in MySQL ah
CREATE VIEW view_INDICATOR AS
SELECT blah, blah, blah, blah
FROM
table_BLAH;
Contents of View comes from the table and will automatically update itself
when the table source will be updated
stored procedure,.. i forgot na eh,.
hintayin natin post ni Raizel
Lyt_Grey- Admin
-
Number of posts : 308
Age : 36
Location : La Trinidad, Benguet
Job/hobbies : Ado ngem basit lang
Reputation : 0
Registration date : 2008-12-04
Re: vb.net long sql command
Eto, funny string concatenation in VB 2005
Dim query As String
query = "SELECT "
query = query & "userName, Password "
query = query & "FROM "
query = query & "tbl_UserAccounts "
query = query & "WHERE "
query = query & "userID = '143' "
cmd.CommandText = query;
Dim query As String
query = "SELECT "
query = query & "userName, Password "
query = query & "FROM "
query = query & "tbl_UserAccounts "
query = query & "WHERE "
query = query & "userID = '143' "
cmd.CommandText = query;
Lyt_Grey- Admin
-
Number of posts : 308
Age : 36
Location : La Trinidad, Benguet
Job/hobbies : Ado ngem basit lang
Reputation : 0
Registration date : 2008-12-04
Re: vb.net long sql command
Pwede rin ciguro to
Dim query As String
query = "SELECT "
query &= "userName, Password "
query &= "FROM "
query &= "tbl_UserAccounts "
query &= "WHERE "
query &= "userID = '143' "
cmd.CommandText = query;
Dim query As String
query = "SELECT "
query &= "userName, Password "
query &= "FROM "
query &= "tbl_UserAccounts "
query &= "WHERE "
query &= "userID = '143' "
cmd.CommandText = query;
Lyt_Grey- Admin
-
Number of posts : 308
Age : 36
Location : La Trinidad, Benguet
Job/hobbies : Ado ngem basit lang
Reputation : 0
Registration date : 2008-12-04
Re: vb.net long sql command
pg 2008 pla pwd khit ung _ lang..
pero sa 2005 klangan & _
pero sa 2005 klangan & _
mye- Staff Sergeant
-
Number of posts : 113
Age : 36
Location : La Trinidad
Job/hobbies : Computer Instructor
Reputation : 0
Registration date : 2008-11-27
Re: vb.net long sql command
mye wrote:pg 2008 pla pwd khit ung _ lang..
pero sa 2005 klangan & _
yun pala eh...
so instead na ganito
query = "select "
query &= "from "
eh ganito nalang
query = "select " & _
"from "
Lyt_Grey- Admin
-
Number of posts : 308
Age : 36
Location : La Trinidad, Benguet
Job/hobbies : Ado ngem basit lang
Reputation : 0
Registration date : 2008-12-04
Re: vb.net long sql command
Pero I still recommend views and stored proc for that kind of query...
Easier to modify your program for flexibility...
Easier to modify your program for flexibility...
Lyt_Grey- Admin
-
Number of posts : 308
Age : 36
Location : La Trinidad, Benguet
Job/hobbies : Ado ngem basit lang
Reputation : 0
Registration date : 2008-12-04
Re: vb.net long sql command
oo nga eh.. tnx po :-)
mye- Staff Sergeant
-
Number of posts : 113
Age : 36
Location : La Trinidad
Job/hobbies : Computer Instructor
Reputation : 0
Registration date : 2008-11-27
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Fri 25 Jan 2013, 12:12 pm by remase
» VB.net+mysql connection string
Wed 11 Apr 2012, 12:51 pm by markjeggar
» pa visit nmn
Tue 03 Jan 2012, 1:37 am by Generym
» How to de-active your account here?
Tue 27 Dec 2011, 1:57 am by Generym
» Team Building
Sat 26 Nov 2011, 5:31 am by kate
» Check attendance: name and batch, currently working at?
Fri 09 Sep 2011, 4:35 am by kuratcha
» I wonder!!!
Fri 01 Jul 2011, 2:08 am by Generym
» happy experience
Sun 01 May 2011, 10:07 pm by i337
» how smart is your smart phone?
Sun 01 May 2011, 9:56 pm by i337