Click here to Skip to main content
14,871,055 members

Comments by memberxxxxxxxxxxxxxxxxx (Top 20 by date)

memberxxxxxxxxxxxxxxxxx 28-Feb-14 13:53pm View
what i've done so far, and i think this is similar to what you are suggesting, but i'm very much a novice, is to run the code to a specific section using the run to cursor. from there i checked the inputs i have.

so for the datatable preangle, i checked the pabcbll table that i imported and in vs you can look at the datatable. for that particular table, there was only one row with a value of 4.2 for step and a value of 1.09533.....for the zval.

that table is very real and it exists...sorta, but for some reason, the values don't seem to be passed along into the zval and xstep for the calculations.
memberxxxxxxxxxxxxxxxxx 28-Feb-14 12:09pm View
that's kinda the strange part. the table i am importing has only one cell. the step value is 4.2 and the zval is something like 1.09533 something. i know for sure there are values, they just aren't being transferred/read
memberxxxxxxxxxxxxxxxxx 13-Feb-14 13:55pm View
the number of rows changes depending on the inputs from the user. that's why i tried to limit the function.

for this loop...
b2d = 8.6
b5d = 1
b16d = 0

i also added a new line in the code so the exception changed to:
"number too large or small for decimal.

so the first calculation should be...

_______ + 0
(8.6 + sqrt(8.6^2 - 1*0^2)

shouldn't that add up to 0?

also...thanks for the help :)
memberxxxxxxxxxxxxxxxxx 27-Jan-14 14:56pm View
i think it's 99% of the way there. i'm expecting a value of 1.4475 but getting a value of "1" instead. any ideas why that might be?

edit: figured the last bit i had wrong. thank you very much for the help.

thank you very much for the help btw. i've edited the original post to reflect the final code.
memberxxxxxxxxxxxxxxxxx 22-Jan-14 14:25pm View
i think that's what i'll end up having to do. thanks for the help, i really appreciate it.
memberxxxxxxxxxxxxxxxxx 22-Jan-14 14:08pm View
i had something completely different in mind lol. but stress relief is always good.

i could use stress relief now :P, i tried collapsedsize...nothing :(
memberxxxxxxxxxxxxxxxxx 22-Jan-14 13:28pm View
ok, made the changes, you suggested and i also added something as a test.

if you look in the page_load...i added lines to have one panel collapsed on load, and the other to be open. just wanted to see how it works...nothing. both panels still open on load.

i've edited the original post to reflect the code as it is now.

thanks for the help btw, turning those bowls? lol
memberxxxxxxxxxxxxxxxxx 22-Jan-14 13:16pm View
didn't seem to do the trick. i swear though...if that fixed it i was gonna go home for the day lol.

i did add the autopostback property in the html though, that ok? or does it have to be in the codebehind?

i suspect the problem has to do with my if statements and/or my radiobutton values. in the html, i have the values set as 1, and 2 and in the codebehind i used those values in the if statement, not sure if done properply?
memberxxxxxxxxxxxxxxxxx 21-Jan-14 18:12pm View
soryr it took so long for me to get back to you thank you for the help. really appreciate it
memberxxxxxxxxxxxxxxxxx 15-Jan-14 12:46pm View
doesn't seem to make much of a difference.

i guess a question now is...and this really makes no sense to me...
can i send in a "varchar" to a sproc to retrieve decimal values?

or better yet...can i even have decimal values as an output? do i have to pull them out as varchar and then convert? i don't see how i can even do that with the table structure as is.
memberxxxxxxxxxxxxxxxxx 9-Jan-14 16:16pm View
thanks. appreciate the help. it's always the small stupid things that get ya
memberxxxxxxxxxxxxxxxxx 27-Nov-13 14:46pm View
thank you very much!!!
so if i leave off the (5,3)...sql automatically uses precision 0? out of curiosity...why does the query "9.1" work in queryview, but not in runtime?

once again, thank you
memberxxxxxxxxxxxxxxxxx 27-Nov-13 14:27pm View
honestly, i'm not sure. when building the table, i set the bc column as decimal(5,3) so that means 5 total numbers with 3 after the decimal for precision right? none of my bc values are more than 2 decimal places.

also, i just ran the program to the cursor and stopped here:
var dec = Convert.ToDecimal(TextBox1.Text);
cmd.Parameters.AddWithValue("@bc", SqlDbType.Decimal).Value = dec;*******cursor

i see that the var "dec" = 9.1 so it should give me the proper fileSymbol.

i then ran the cursor to here:

string outputValue = cmd.Parameters["@fileSymbol"].Value.ToString();
Label1.Text = outputValue;
and i see that the outputVal = "Q" which is incorrect.
memberxxxxxxxxxxxxxxxxx 6-Jul-13 15:15pm View
thanks i appreciate the help. worked out just as you said. just needed to run it in a stored procedure
memberxxxxxxxxxxxxxxxxx 4-Jul-13 5:14am View
lol it wouldn't surprise me. basically, i have a table of people, one of the columns has their zipcode. that zipcode is tied to a zipcodes table that has the zipcode, city, state, latitude and longitude. i'd like to add a filter that retrieves people within a radius of a specified zipcode, but i'd like to be able to put in the radius and the zipcode.

so i found those functions and tried incorporating them in my site, but i don't know much about sql and ran into the wall.

like i said, i'm using vb web developer. there's a query designer that sort of allows me to test queries and input whatever for variables, but when i try to run the query, nothing happens, just returns the columns, but no data. if i take out the @Distance and replace it with a works.

this is where i got the function:

i tried modifying the sample query for stores lol. not successfully though.
memberxxxxxxxxxxxxxxxxx 4-Jul-13 3:38am View
I was trying anything and everything i could to try to make it work. i tried the first one, not the second. it didn't work. my latest attempt was:

WHERE dbo.CalculateDistance(@Longitude, @Latitude, ZipCodes.Longitude, ZipCodes.Latitude) <= @Distance

and that didn't work.

i'm using vb web developer and trying all this out in the "new query" wizard. i'm expecting the query to ask me for a value for the distance, but it's not and simply returning an empty set. ie no rows, i know very little about sql so i don't want to get the terminology wrong.

i've left off the zipcodes part because that was another source of frustration. i've tried declaring it and replacing the '20013' with @zipcode, but i kept getting an error saying that i had to declare the scalar variable even though i declared it right under the declare for the lat and longitude
memberxxxxxxxxxxxxxxxxx 6-Jun-13 1:15am View
i added a new parameter:

com.parameters.add("@playerPay", sqldbtype.decimal).value = playerPayTextBox.Text;

this doesn't seem to work, i get the following error:
"Error converting data type nvarchar to decimal."

so then i tried this:
com.parameters.add("@playerPay", sqldbtype.decimal).value = playerPayTextBox.tostring();
i get the same error:
"Error converting data type nvarchar to decimal."

which makes sense, so then i tried:

com.parameters.add("@playerPay", sqldbtype.decimal).value = decimal.parse(playerPayTextBox.tostring());
error: "Input string was not in a correct format." - then the datetime thing...

com.parameters.add("@playerPay", sqldbtype.decimal).value = decimal.parse(playerPayTextBox.text);
error: "Input string was not in a correct format." - then the datetime thing...

not sure what to do
memberxxxxxxxxxxxxxxxxx 28-May-13 19:44pm View
thank you for the help.
memberxxxxxxxxxxxxxxxxx 23-May-13 2:39am View
thank you. i am curious, i thought this method opened up the possibility of sql injection attacks?
memberxxxxxxxxxxxxxxxxx 13-May-13 11:49am View
thanks for the help.

first time i tried it, i didn't have the ' near the select and at the it said incorrect syntax near the select.

second time i put the little quote marks in and now it says...
"The data types varchar and varchar are incompatible in the modulo operator."

as i understand it, datasets are old school, but i've been following the data walkthroughs...i'm learning lol.

i made the tableadapter using sql statements. does this method still work for that?

for added info...when i made the adapter using the dataset wizard, it says that the DECLARE sql construct is not supported.