« first day (1944 days earlier)      last day (3010 days later) » 

10:00 PM
the thing is , On the other pages , i Pass it as a String ! and SQL itself ! convert it !
but here ! i pass String or Long or Int , all same error :|
var Cook = Request.Cookies["PSPLogin"];

Steam64ID = Cook.Value;
Steam64ID = Encrypter.Decrypt(Steam64ID);
 
user47589
what is the actual value you're trying to insert?
 
user47589
it apparently can't be converted to a bigint.
 
its a Steam64ID
My site use OpenAuth to login with Steam site
encrypt the Steam64ID save as cookie
 
user47589
Again, what is the actual value? Set a breakpoint on that line, look at the value, and paste it here.
 
after succesfull login
76561198048392639
this is an example
 
10:03 PM
Is this the ideal way to do a upload of files, from client to server?
        function UploadFileAndGetResponse() {
            var form = new FormData();

            var id = $('input[data-rel="productId"]').val();
            var company = $('input[data-rel="company"]:selected').val();
            var files = $('input[data-rel="fileUpload"]').get(0).files;

            if (files != '') {
                form.append('Id', id);
                form.append('Company', company);
                form.append("Upload", files[0]);

                $.ajax({
                    type: 'POST',
 
i can't breakpoint it there :( that make things hard, i can't actually make a Successfull Transaction From a Localhost:xxxx Address lol, so i have to run it on my server with a valid domain to Connect to a Bank Gataway
this page only happen after a succesfull payment
 
@Pedram I'd pass a DbType with each parameter
like DbType.Int64
 
hmm i never use DbType lemme check how u use it
 
Wait does AddWithValue not have an overload that takes type? shit
 
nope it only have 1 overload
Name and Object
 
10:09 PM
@MikeAsdf AddWithValue attempts to auto infer type.
 
ooooooh i am stupid
i know how to test
 
looks like I'm more used to database.AddInParameter(cmd, name, DbType.Int64, value);
 
i just write 76561198048392639 this time as the value
 
@MikeAsdf You would need AddParameter("Parameter Name", SqlDbType.NVarChar, 50).Value = "Blah"; if you want to specify.
 
if it works the the problem is at before , if it not work then problem is at something else
hmmm when i write AddParameter( i only get Overload of String ParameterName Object Value
 
10:13 PM
@Pedram Sorry, it is just command.Parameters.Add
 
Well, i just Tested, Problem seems to be something else ... i went and write the number directly w'o any cookie reading or decrypting
and it still gave same error
while same thing work on other place
is writing this for Insert right ?
INSERT Into PurchaseHistory (TransID,GetID,SubIDs,Price,Region,IsProceed,SteamID64) VALUES (@TransID,@GetID,@SubIDs,@Price,@Region,@IsProceed,@SteamID64)
i am so out of idea right now lol
 
hello people of the corn
 
hello
Well fuck it i am gonna Change Database and all my other pages
i will change that stupid bigint
 
So I added an optional string parameter to a constructor. And that suddenly is causing the compiler to complain "The type 'Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy' is defined in an assembly that is not referenced. "
 
into nvarchar
 
10:21 PM
don't do that
 
@Pedram is that a stored procedure or just a string statement?
 
no stored procedure , just a string statement i am running on C#
 
@Pedram The error was complaining about the other direction
you need to "change the stupid nvarchar into bigint"
 
whaaat
 
Have you tried running the SQL manually in like sql management studio or whatever SQL tool of choice?
 
10:24 PM
u mean i need to change the database's nvarchar into Bigint ?
 
@Pedram, no, and by no i mean maybe
 
oh right i have SQL mannagment studio 2014
 
sql manna
 
i check now
 
INSERT Into PurchaseHistory (TransID,GetID,SubIDs,Price,Region,IsProceed,SteamID64) VALUES ('12345','4567','5678',42,'US',1,6666666)
 
10:24 PM
no
 
wait what's the type of SubIDs
 
If that works, then I'd guess the the command is somehow incorrectly inferring db types
If that fails, then I'd guess there's some wrong assumptions about the table
Like maybe the table has a trigger that's doing something to cause the error
 
no
 
hmmph ... i can't connect to the server sigh ... stupid net
 
10:30 PM
lol
no
I need more lemon pledge
 
finally connected ! now testing :D
 
So back to my problem, why the fug could adding a string param suddenly cause dependencies to change?
 
user47589
no idea
 
user47589
what constructor is it?
 
user47589
or, what type?
 
10:36 PM
Initech.Data.Adapters.BaseDao
 
user47589
oh, not something from the framework
 
user47589
Initech? Didn't that place burn down?
 
user47589
is it a partial class?
 
nope
 
Ugh.
I can't figure out why so much memory is being consumed.
 
10:40 PM
 
INSERT Into PurchaseHistory (TransID,GetID,SubIDs,Price,Region,IsProceed,SteamID64) VALUES ('12345','4567','5678',42,'US',1,6666666)
Worked
 
Anyone have a moment for some JavaScript?
If I do a file upload, I've got the data. But I want three separate fields to pass to a service via Ajax with it, should I build a small object or just use form.append all of it? But the form.append doesn't appear to work correctly.
 
@Pedram this might be superfluous, but I'd try adding DbType explicitly on all your parameters on the command
@Greg json all the things
 
funny thing is even '666666' also work ! it automatically convert it i guess
 
@MikeAsdf So, don't do formdata just build an object and stringfy?
@MikeAsdf I posted an example above, if you could take a look and tell me what I did.
 
user47589
10:47 PM
tell you what you did?
 
user47589
you.... don't know?
 
@Amy I know what I did, if he could show me where I deviated or what he thinks would be better
 
how do i use the Parameters.Add() for adding string for example ? O.o i check the 3rd overload , it says , (String ParameterName, Parameter Type, int size )
what is int size ?
no value
 
@Pedram If Sql has a string for varchar(3) then the size would be three and type varchar, if it nvarchar(25) then it would be a type of nvarchar and size of 25
 
@Greg yeh Microsoft Example got it now :D
    command.Parameters.Add("@ID", SqlDbType.Int);
    command.Parameters["@ID"].Value = customerID;
size not needed i guess :D
 
10:59 PM
So how would I upload the input type="file" via JSON?
 
split it into bits, hit your endpoints
 
???
 
ffffffffffffffffffffuuuuuuuuuuuuuuuuuuuu
So i change and make all using Parameter.add with the correct type and still same error
 
@Codeman The problem I have, is on the backend. I don't see the data in the context.
 
........ does IIS Cache ?
I change the Controller.cs but seems like it still using the old controller
i mean Checkout.cs in Controller Folder
 
11:14 PM
maybe the browser is caching
hit Ctrl+F5 for a more forceful request
 
no, it's that, The Region was null ! and Steam64ID was wrong !
then all we did and i did
for past 2 hour
seems to not change the error
coz it actully never changed anything
coz i always had Region "US" now
finally i change database and made Bigint into nvarchar
it worked now ! saved in database ! but Region is like old time null and Steam64ID is wrong
so its using the old controller
 
that sounds like a compile/deployment staleness issue, not a cache issue
 
in the inetpub\wwwroot\Controllers the controller file is indeed updated but it still use old one
weird
 
huh apparently the code I was thinking of in our app doesn't use json
@Pedram When you say controller file, do you mean the cs file?
 
yes
 
11:25 PM
IIS never uses cs files directly. It uses compiled DLLs.
 
:|
 
The only things it dynamically compiles are markup-like files such as cshtml, aspx, etc.
 
then why is it there ? shouldn't i just remove it from that directory so better security ? lol
 
depends on your deployment process
 
uuuuurgh +2 hour wasted :D
 
11:27 PM
Is it the only copy of the file in existence? Do you have source control?
 
yeh it's ok i will just Recompile the whole site and Copy paste all of it to the wwwroot folder
I was just changing the .cs files in the Controller Folder just now ....
 
I forget what simple techniques exist for deploying IIS. I've always dealt with enterprisey scripts using things like custom MSBuild tasks and azure powershell helpers.
and locally, visual studio just manages it for me when I compile
 
Well i made my whole site in 1 go 2 months ago , i used to Recompile each time and copy paste the whole ~400mb site
but now i come after 2months to fix this part
i just used the .cs file and didn't want to make a new compile, guess mystery solved :P
it works now with BigInt too !
dang
 
DbType reminds me of a good campfire story though
 
lool :D
 
11:33 PM
We were using table-valued parameters, passed into some stored procedures
In the C# code we constructed some DataTable instances, set up some columns by name, inserted rows, and passed the table along as a param.
Thing was, the DataTable was automatically defining all the column types as string, but it worked (sql server inferred things correctly in the sproc params) so we didn't notice
Until we suddenly had some errors in a british server because datetime.ToString() was flipping the month and day around
And it was hard to determine at first, because unlike our previous similar british errors, we weren't explicitly calling ToString in this case
 
lol damn
 
The solution was to explicitly define column types on the in-memory DataTable used as the parameter
so it would stop calling datetime.ToString behind the scenes
 
Well, i guess even tho wasted +2 hour on a stupid mistake :D at least i learned how to Add parameter with specific Type :P
i used AddWithValue always till now :P
 
11:54 PM
@Amy - If I have something like var x = 5; which is returning "number" from typeof(x), can you think of any way to make it also be able to have a property attached?
 

« first day (1944 days earlier)      last day (3010 days later) »