« first day (1823 days earlier)      last day (3111 days later) » 

12:28 AM
posted on October 13, 2015 by Scott Hanselman

A s you may know, I'm a Type 1 Diabetic and have been for well over 20 years. I wear a Medtronic Insulin Pump 24 hours a day and use a Dexcom CGM (Continuous Glucose Meter) to monitor my blood sugar, also 24 hours a day. This post won't explain how diabetes works to you, so check these posts out (or this video) first if you're not familiar. Scott's Diabetes Explanation: The Airplane Ana

 
 
4 hours later…
4:50 AM
Hi there
Can someone please help me to add dll files in web.config manually?
i am new in .net
and i am writing code in .aspx file in Notepad++ software
So i can not add dll through Visual studio
 
5:37 AM
if you don't have any restrictions as to what you have to use (framework wise) I would use the new ASP.Net 5 as it will make you life a hell of a lot easyer if you cant use VS
also its Open Source (github.com/aspnet) and crossplat
 
Hi, @Alex
 
Hi @mark
 
Can you help me now?
public void AddedToday() {
dt.Connection();
MySqlCommand cmd = new MySqlCommand("SELECT COUNT(date_of_application) as CountDate FROM tblcustomers", dt.connect);
MySqlDataReader dr = cmd.ExecuteReader();

var DateNow = DateTime.Now.ToString("MM/dd/yyyy");

if(dr.HasRows == true){
dr.Read();

var DateFromDB = Convert.ToDateTime(dr["CountDate"]).ToString("MM/dd/yyyy");

if (DateNow == DateFromDB)
{
lbl_salaryadded.Text = dr["CountDate"].ToString();
}
}
dr.Close();
}
I want to view how many data has been added today. But the result is 0.
 
5:54 AM
im no expert but CountDate would be an int not a datetime
it would be something like:
SELECT COUNT(*) as CountDate FROM tblcustomers WHERE date_of_application = somedate
or you could group by dates
SELECT COUNT(*) as CountDate, date_of_application FROM tblcustomers GROUP BY date_of_application
that would give you a row for each date (asumeing the date is just a date not a datetime)
 
6:08 AM
Thank you @Alex even though you didn't give the right answer, you gave me some ideas. :D Thank you!
 
6:40 AM
Will someone plz help me out with this issue : stackoverflow.com/questions/33095724/…
 
7:05 AM
@Slashy I fixed in the Desktop Duplication API, yes, but a move region still corrupts the viewer at the moment. I probably implemented the CopyRegion function wrong :-)
 
@RoelvanUden whats your opinion on using something like edge.js with electron?
 
@Alex If the goal was cross-platform, then it's a big no-no.
@Alex Otherwise, could be nice, but usually you don't need C#
 
what are you making again?
 
who?
 
7:12 AM
@RoelvanUden I was mainly looking at it from the point of view of reusing business logic
Also it has some Ok support of coreCLR so far, and mono at the moment
 
@Alex I wouldn't bother tbh
 
7:44 AM
I'm managing too much in memory
 
@StevenLiekens I know the fealing
 
I'm not talking about code
 
lol
 
8:03 AM
logging.apache.org/log4net/release/sdk/… didn't I say character encoding is hard
 
@StevenLiekens to apache maybe lol ... seems to be easy to the rest of the world though
 
Nah it's still hard - but it has been sufficiently abstracted in most frameworks to appear simple.
 
It depends on which character encoding you support. If it's just UTF-8, it's relatively straightforward. If, like .NET, you must support a whole bunch; then it's a PITA
 
I'm pretty sure log4net can be described using only ASCII
and they still messed up
 
8:47 AM
intellisense + tired programers can be dangerous
overzealously used the auto complete function last night picked the wrong thing had to spend 5 mins this morning working out why the tests where failing on a stackoverflow
 
I got a bug like that somewhere in my code
changed some things, all tests pass, program still breaks in a weird way
I guess I need more tests
 
yeah i have had a few bugs that don't show on the unit tests but show on one of my longer running intergration tests
 
9:19 AM
o/
 
o/
 
\o
 
9:33 AM
<o/
SO chat doesn't work in the VS embedded web browser
 
didnt even know it had one
 
If you host VMs on Azure, can Azure reboot them at will? I presume yes
 
@Alex Ctrl+W, W
 
@Squiggle doesnt work on 15 pro
but does on comunity
 
9:50 AM
I'm still on VS2013 Premium
Mmm. Very premium.
 
CTRL+ALT+R on 15
 
@AlexH Not here, adds ®
 
from what i can tell its difernt if you did a fresh install (like i did) or had another ver installed
 
Maybe
 
Also it looks like SO chat works on 15 (on win 10)
 
9:55 AM
I've 2012/2013/2015 installed
 
2010/2012/2013 here.
I still need to use 2010 for some things :(
 
2013 only here lol
Half my team use 2015 because they say it's better
Bet they don't use any other features
 
does 2013 have the task runner?
 
10:45 AM
error converting data type nvarchar to int
cmd.ExecuteNonQuery();
cmd.ExecuteNonQuery();
 
10:58 AM
Don't try to convert nvarchar to int then.
 
11:20 AM
"Doctor, it hurts when I do [x]"
"Well don't do that, then"
 
hi any one help me for this
0
Q: In genric list values passing to xml . How to perform Insert and update operations sql?

MuthuScenario : 1.Form having gridview with 5 records. (binding records FROM database) 2.one more record am selecting to autocomplete and then adding to gridview. 3.next deleted one more record from that gridview then passing values to DB through XML. my xml code like this <?xml version="1.0"?> <Arr...

 
room topic changed to C#: Illiteracy helpdesk // Read the rules: csharpchat.com [.net] [asp.net] [asp.net-mvc] [c#] [entity-framework] [linq] [visual-studio] [wcf] [wpf]
 
i have to insert first temp table then insert into table right??
 
Not at all.
sorry I'm not really paying that much attention right now :P
(on the phone)
 
 
1 hour later…
12:34 PM
@Muthu what is OPENXML(@XmlHandleSAVELANGUAG,'/ArrayOfLanuageInfo/LanuageInfo')?
 
good morning
happy tuesday
smile, it's tuesday - it could be worse, it could be friday
 
it could be worse better, it could be friday
digging up for a second driveway this weekend - am looking forward to it
 
Nothing like some hard work. Unless you're using a excavator ;)
 
12:51 PM
@juanvan SQL lets you query XML with XPath. It's ugly, but not entirely terrible.
 
Never used it - it issss Ugly
 
but it's the right place for that sort of logic!
 
I hate delete happy people - thank god for backups or I might have fired someone
 
Hey guys need your advice, I have a service layer and everyone of my service has an async method that routes the call to its private equivalent by using Task.Run(() => this.EquivalentMethod()) .. is that good practice ?
 
@SteveHémond does it actually abstract any of the logic? Or is it just a direct call?
 
1:03 PM
direct call, just for the sake of running returning a Task to my UI
 
it smells
 
i was wondering if it's not better to initiate the async call directly from the UI
 
that would be my preference.
 
yeah ... time to refactor. Thanks man
 
unless there was any other way, it just sounds like a layer for the sake of it. Was it written by you? :)
or did the original author have a reason?
 
1:12 PM
written by me :)
 
@SteveHémond If it's CPU-bound, why is there even an Async version?
 
@RoelvanUden What do you mean by "CPU-bound" ?
Some of the methods takes between 300ms and 1s to return the data and I don't want the UI to freeze during that call.
That's the main reason I call the method in an async manner
 
Then you should not use Task.Run in the first place.
Implement them in an Async manner.
 
@juanvan that one xml string @SAVeLANGUAGE_DETAILS VARCHAR(max) =NULL
 
Otherwise you're just creating threads to block.. which is bad.
 
1:19 PM
@juanvan code like this IF(@SAVeLANGUAGE_DETAILS IS NOT NULL)
EXEC sp_xml_preparedocument @XmlHandleSAVELANGUAG OUTPUT, @SAVeLANGUAGE_DETAILS
 
@RoelvanUden Do you have an example of how to "implement them in an async manner" ?
 
@SteveHémond Where you can use Async functions, use them.
Quite as simple as that.
e.g. instead of Stream.Copy you use Stream.CopyASync
 
So I should use the EF async methods instead of the sync ones ?
like ToListAsync() etc ?
 
Yes.
Then you actually get the benefits of async/await. Otherwise you don't.
 
ANUUUUUUUUUUUUUUUUUUUUS!
 
1:26 PM
@Muthu Does that If execute?
sorry I did not really read the problem
 
Anybody here familiar with the Bloomberg terminal API?
 
Hey guys
I have issues with submitting to database
 
@juanvan I have passing values from Ui XML format then am selecting values from that XML and inserting into DB ok.
 
@Guzzyman Just kneel and praise database. You will submit accordingly in no time.
7
 
@Failsafe roflmao
 
1:31 PM
@Muthu sounds easy enough
 
my computer loves me
 
@juanvan before inserting am deleting all existing records by Id .then inserting so am losing primary key right every time delete and insert means??
 
I am here for a day. had training all last week, monday off, in office today and more training the rest of the week
i hate training
 
@FailSafe: I have knelt...please make me submit into the database
 
I like trains
 
1:33 PM
@Muthu then you are updating not inserting
UPDATE SET VALUE = "" WHERE ID = @SOMEID
 
DELETE FROM [dbo].LANGUAGE WHERE [HOSPITAL_ID]=@HOSPITAL_ID
Removes it from the DB id 123 is gone
i can't insert ID 123 again or I really need to sit with an SQL server
 
@Muthu @ton.yeung I'm just writing up an example right now...
 
@juanvan ok
 
using SQL Merger
 
1:42 PM
yarp
it's actually pretty elegant :)
 
@juanvan u can insert but no deletion every time right??
@juanvan if not there means insert otherwise update the record that's correct right??
 
YeS!
 
@juanvan but see my code deleting and again inserting so am losing primary key
 
Yes that is what is happening
 
0
A: In genric list values passing to xml . How to perform Insert and update operations sql?

SquiggleThis is an ideal candidate for the use of a SQL MERGE. It allows you to insert/update/delete based on matching criteria in a single statement. Check the Microsoft Technet reference for further information. Edit: Here's some example code for using SQL MERGE alongside OPENXML declare @idoc int; ...

anyone please critique the codez
MERGE INTO @myTable AS Target
USING
	OPENXML(@idoc, 'data/item', 2) WITH (id int 'id/text()', name nvarchar(50) 'name/text()')
	AS source
ON Target.id = source.id
WHEN MATCHED THEN UPDATE SET name = source.name
WHEN NOT MATCHED BY TARGET THEN INSERT (id, name) VALUES (id, name)
WHEN NOT MATCHED BY SOURCE THEN DELETE;
customise as appropriate
 
1:47 PM
that looks cool but don't know when I would use it
 
sorry for the copypasta
 
@Squiggle ok thanks i will check that code if any issues i let u know
 
@ton.yeung in a bit. I'm currently installing some strobes in the chassis.
 
and in other news playboy is no longer doing nude photos :( little bit of every teenage boy has died
 
@juanvan Pornhub is though.
 
1:49 PM
@juanvan Internet strikes again! bwahaha!
 
It's not the same as old fashioned woods porn
 
So if you're younger than the playboy generation nothing changed.
 
No more air brushed celebrities
 
Who looks at playboy anymore... I can get nudes of probably anyone on the planet faster and less awkward than going to purchase/look at a playboy magazine in barnes and noble.
 
@Failsafe anyone?
 
1:51 PM
No one wants to be that guy picking up a playboy in front of some kids reading avengers, then get that wierd stare from their parent as you walk off with jerk material
 
do it to give the news stand clerk the wink
@Failsafe Hustler is jerk material
 
whats going on?
 
@NaveenNikhil We are discussing jerking it
@juanvan Well same situation except replace playboy with hustler
 
or the lack of jerking in the next generation
 
No the jerking is tenfold
The time it takes to go pick up a playboy is now round 1
after that is round 2
i doubled my ROI
because of the internet
 
1:54 PM
as simple and changing the laundry
 
Oh Yooo
 
@ton.yeung is it obvious I don't car?
I'm 32 and have never even tried
 
never drove a car?
 
never :D
I'm a city boy
 
That is good no payments or DUIs
Could never get home if I did not have a cart
 
2:03 PM
My commute is 7 minutes by bike. If I had a car even parking would cost ~200CHF/month.
I've never had a reason to even want to learn. Perhaps I'll try when electrics become more efficient and affordable.
 
Sup
Anybody had muche xperience marshalling data across DLL?
 
Just ask your question..
 
^
 
Good ol Roel
 
minimal. I have used cygwin compiled dll's void* returning function in c# side
 
2:13 PM
Where's @TomW when you need him
 
Ive got a function that just isn't doing what I expect it to
 
        try
        {
            DbConnection.checkConnection();
            SqlCommand cmd = new SqlCommand("SELECT * FROM TimeMargin", DbConnection.con);
            SqlDataReader reader;
            DbConnection.con.Open();
            reader = cmd.ExecuteReader();
            if (reader.Read())
            {
                comboBox1.Text = reader["Margin"].ToString();
                MarginID.Text=reader["Id"].ToString();
            }
            DbConnection.con.Close();
        }
        catch (Exception ex)
 
Guys you are great, you have solved it
Lol
 
Uuhm..
 
error converting data type nvarchar to int
try
{
DbConnection.checkConnection();
SqlCommand cmd = new SqlCommand();
cmd.Connection = DbConnection.con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "UpdateMargin";
cmd.Parameters.AddWithValue("@Margin",comboBox1.Text);
cmd.Parameters.AddWithValue("@Id",MarginID.Text);
DbConnection.con.Open();
cmd.ExecuteNonQuery();
Verification.Save();
DbConnection.con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
 
2:17 PM
@MirzaJhanzaib Convert your .Text to int
 
this line error
cmd.ExecuteNonQuery();
Verification.Save();
DbConnection.con.Close();
 
Try
cmd.Parameters.Add(new SqlParameter("@Margin", SqlDbType.Int).Value = Convert.ToInt32(comboBox1.text);
idk if that is syntactically correct or even the items you were asking for
 
@MirzaJhanzaib .Text == string == nvarchar
 
i never do addwithvalue
i don't trust the implicit conversion
@ton.yeung Nope. You looking to open a line of credit?
Oh I don't use quicken
you doing taxes?
I use Mint
I wish i didn't but they already have my information so it doesn't matter anymore
 
cmd.Parameters.Add(new SqlParameter("@Margin", SqlDbType.Int).Value = Convert.ToInt32(comboBox1.text);
this is not correct
 
2:23 PM
@MirzaJhanzaib Please tell us why.
 
show input string is no corrert
input string is not correct formt
 
— What do you get when you play a country song backwards?
— You get your house back, your wife back, your dog back, your truck back...
 
@MirzaJhanzaib it's probably the MarginID.Text that needs to be converted to an int
 
lol
howdy folks
 
hello mister @ShotgunNinja
 
2:27 PM
i am using emply attendences and give margin
how to solve it
 
0
Q: Append Query String for a specific page in Rewrite Rule Web.config

Ram SinghI want to add open the following page http://test.com/Collection.aspx?title=Women as http://tests.com/Women and http://tests.com/Collection.aspx?title=Women as http://test.com/pathann I have tried to use below rewrite rules but these are working for all page, i just want to implement fo...

please help me
 
@RamSingh you can leave only the redirect rule there, and get rid of 2nd rule replace it by routing
 
@tw
@tweray can you please answer me with what exactly you want to sat
*say
 
2:45 PM
To reinforce my previous point: For a giggle, go and download and install the Oracle Data Access Components package, 32 bit. Is it not the worst UI you have ever seen?
 
hey Guys, if I lost admin rights on my work machine
could that have messed up and prevented visual studio from using entity framework to connect to a DB?
 
@BobSinclar RIP
 
RIP?
rest in peace
ie would loosing admin rights kill using the DB ? is that a yes @Failsafe
i sent the same code to a vm on azure
and it works there
and i deployed it to an azure website and it works fine
 
what is the authentication method?
win or sql
 
@BobSinclar No I was not being funny
 
2:49 PM
both @ntohl , i have an azure db that uses sql authentication
and my localdb uses windows
neither work
 
are you using a hostname that is not part of the same domain
 
* i had admin access last thursday everything was peachy. Restarted my machine and friday i lost admin access and it wont work locally
yes the hostname is different
whats weird is on a vm in azure it works right (but i have admin access there).
IT is slow on giving admin access
so i am trying to make sure its nothing else
 
can you load a VM without admin access and try it
 
oh great idea
yes i can
 
anyone tried angular + web api
mvc c#?
 
2:55 PM
I have @EuphoriaGrogi
i am a fan
 
same
 
what is the design :D
 
im a fan of anything without views
 
im confused what are things need to keep in mind
 
pretty much use webAPIs to serve up a restful api
and only consume it using JS
 
2:56 PM
can u give me a clear path like for example
in client side
lazy loading of files
please share to me your ideas please
much appreciated :3
im an active stack user bdway
 
i already read this :3
 
is agnostic to whether your backend is rails or .net
or anything restful
its really about the front end framework
 
my backend is restful .net
 
so what are you having an issue doing
 
2:58 PM
how to control the routing of views?
let me clarify the question
considered i have states
like 'home'
etc
'create'
what is the best way to handle routing?
currently i have this
i think its an overkill
@BobSinclar you there bro?
 
How do I get a subset of an array in C#? Like things[3:] in python or things + 3 in C?
 
@QuestionC Linq, or Array.Copy
 
how to solve it
 
@QuestionC values.Skip(3), values.Take(10), values.Skip(3).Take(20)..
Yeah he's essentially asking about array comprehension
But lacked the terminology to do so :P
That or lazy, or assuming everyone knows that god awful python
 
3:14 PM
disregarding performance, i somehow like python ;)
 
I described exactly what I wanted in two different and incredibly well known programming languages. Sorry I couldn't be more on the dot than that.
 
eh. shrug
@QuestionC LINQ is where it's at.
 
3:38 PM
Do companies normally get cyber insurances?
What will that insurance help you with?
 
@ton.yeung Especially sensitive data
 
Thank you. Linq is doing what I wanted.
 
not getting sued
 
Like after data breach? To pay law suits?
 
or any insurance
it alleviates financial responsibility
@ton.yeung that work's way better
@ton.yeung you have a business degree?
ahh MIS
 
3:42 PM
Target data breach: The actual total has now reached a gross expense of $191 million. That amount was partially offset by a $46 million insurance receivable in 2014.
 
im surprised its not a BA in MIS
it's enterprise oriented business
where i went all MIS was BA unless they took a specific amount of science courses
it honestly is school specific
excuse me
BBA
not BA
my school was ike 90% CS though. I have a BS in CS with a minor in systems administration
depends on who you were
shit i gtg to lunch
just got the text
ill reply later
 
3:59 PM
Why does GetFileName not work as expected?
http://is.gd/tf3G34
It returns the full path, not just the filename...
 

« first day (1823 days earlier)      last day (3111 days later) »