« first day (3279 days earlier)      last day (1891 days later) » 

Jay
Jay
19:00
@ABuckau I tried that and it still says it needs a comma
dont have to == cant. (?) never tried before..are you trying yo declare the datetime variable inside the call to the function ie. not going to use it.
tried what
Jay
Jay
@CaptainObvious it is creating an object
So you're in a block which looks like this:
var asd = new Foo{
    bar = val,
    wee = value2
};
Because you cant do variables in that, or semocolons
@Jay i think your usage of tryParse is wrong
Jay
Jay
protected void GetCardData()
{
	using (SqlConnection conn1 = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString))
	{
		string SearchString = txtSearch.Text;
		string PartNumber = txtPartNumber.Text;
		string StartDate = txtStartDate.Text;
		//string EndDate = txtEndDate.Text;

		bool isValidEndDate = DateTime.TryParse(txtEndDate.Text, out DateTime EndDate);

		if (!isValidEndDate)
		{
			txtEndDate.Text = "Bad Date";
			return;
		}
	}
}
19:07
DateTime EndDate;
bool isValidEndDate = DateTime.TryParse(txtEndDate.Text, out EndDate);
@Jay humor me and try the above?
Jay
Jay
okay
it says EndDate does not exist when I do that
Did you include the DateTime EndDate above it?
out DateTime EndDate is perfectly valid tho
Jay
Jay
oh my bad, I didn't see that bit, I'll try it
Jesus christ I'm going to have a fucking aneurysm with this review
19:09
Have you tried restarting visual studio?
It's 90% resharper fucking up the styling so it's really hard to spot actual changes
But It's planned for release tomorrow night
Jay
Jay
@CaptainSquirrel still says it's missing a comma
@WillE. yes
@Jay what version of .net are you running?
working fine for me
Jay
Jay
is there a command for finding .net version?
yes
but you should be able to see what version your project is targeting
wait
hooooold up
19:12
What the fuck is that
does txtEndDate.Text have a value?
Jay
Jay
If they type in a date it does
Gotta ask, you're 100% positive you're looking at the right file?
Jay
Jay
@WillE. yes
19:16
I don't think this will be your issue, but you might want to do a string.IsNullOrWhiteSpace check on that before you get to the try parse @Jay
Jay
Jay
when the page loads the end date does not have a value
Jay
Jay
@CaptainSquirrel okay
@CaptainSquirrel Compile issue so that shouldn't matter
@WillE. no, but it will in the future
Jay
Jay
19:17
@CaptainSquirrel that textbox is blank when the page loads, but they can enter dates to filter the results
This works
Might want to use a datepicker or something to ensure you always get an actual date
Jay
Jay
it is a datepicker, sorry
but they can still type 11111111111111111111
Datepickers to have an actual date field
@CaptainObvious that's not entirely true
19:19
SelectedDate IIRC
is this winforms or web dev
I'm assuming winforms
Jay
Jay
winforms
I'm cutting my web dev teeth at a place that's sort of behind the times, what are ya' gonna do
mkai, ignore me then
19:20
DateTimePicker.Value
Spits out a valid datetime
Shortages.aspx.cs | winforms ? my poor brain today
Oh so you are using Webforms
Not winforms
You poor soul
What the fuck is that meant to be
Abstract art?
Possibly. It's sure as shit not readable code compared to the original line
Pythonistas invaded your visual studio
\
whoops just put my backpack on my keyboard
19:30
@Jay If you change that line to bool isValidEndDate = false; does the problem go away?
Jay
Jay
I changed the freaking variable name from EndDate to bob and it works
The Slippery Snek Bros?
Jay
Jay
something got hung up with that name? I had it set as a string with that same name before I commented that out and did the TryParse
it was originally
string EndDate = txtEndDate.Text;
it is now
DateTime bob;
bool isValidEndDate = DateTime.TryParse(txtEndDate.Text, out bob);
and it works
10/10 Impresssive
Jay
Jay
19:46
no idea why it wasn't working before, but it's definitely working now
bob ftw
@CaptainSquirrel I saved it, closed Visual Studio, re-opened it and changed bob back to EndDate so it's typed exactly like your first suggestion to make it not inline and it is now working
And if you make it inline does it break again?
Jay
Jay
let's find out
yes, it says it's expecting a comma again
20:01
Guessing you're using older version of .net then
Jay
Jay
do you know how I can find that off the top of your head?
found it, it says target framework .NET 4.5.2
Yeah inline variables like that are part of c# 7, framework 4.6.2
user10864482
20:49
hello, fellow sorcerers of the binary council
21:01
hello my little pony
user10864482
hehe
user10864482
I need advice; I'm facing the biggest sql query I ever saw and I don't know how to address it. Everything seem interlinked. If I remove all spacing the query is almost 6 pages long
... pages?
user10864482
8 1/2 x 11 format
also, why do people have these queries?
user10864482
21:05
there is a lot of thing I would change on this project and to have plain sql in c# is something I would change. I would use Entity and stored procedure but unfortunately they didn't think it that way
user10864482
so yea, 1051 words long sql query in plain code
you should use a database for... well... a data... base
not for your business logic
"but business logic says that iban numbers must be this format and this long and the sum should be this"
then put that in your program, not your frigging database
user10864482
I agree with you. When I need to change something it feels like archaeology
user10864482
do you have any suggestion to attack this problem, to debug that?
dont modify the scripts
rewrite the same behavior but then differently
with different tools and different frameworks and different libraries and different languages and different runtimes and different servers and different employers and different countries
user10864482
21:11
:`(
user10864482
well, that will be tomorrow problem, good night everyone

« first day (3279 days earlier)      last day (1891 days later) »