ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.ASP.Net Error: Specified cast is not valid<blockquote><cite>akhter says:</cite> <pre><code class="csharp spaces"></code><code class="csharp keyword">int</code><code class="csharp plain">? d = (</code><code class="csharp keyword">int</code><code class="csharp plain">?)dr[</code><code class="csharp string">"TTW"</code><code class="csharp plain">];</code></pre> </blockquote> <p>Make sure TTW getting integer value. Make debuger and check what value are getting.</p>https://www.aspforums.net:443/Threads/918125/ASPNet-Error-Specified-cast-is-not-valid/https://www.aspforums.net:443/Threads/918125/ASPNet-Error-Specified-cast-is-not-valid/Thu, 30 May 2019 03:48:09 GMTASP.Net Error: Specified cast is not valid<blockquote><cite>akhter says:</cite> <pre><code class="csharp string">"Select Sum(IWeight) as TTW from ConIssuance where CID='"</code> <code class="csharp plain">+ DDLContno.SelectedValue + </code><code class="csharp string">"'"</code><code class="csharp plain">;</code></pre> </blockquote> <p>&nbsp;If your query return null value so integer throw error for that you need to make nullable int refer link and make nullable integer.</p>https://www.aspforums.net:443/Threads/918125/ASPNet-Error-Specified-cast-is-not-valid/https://www.aspforums.net:443/Threads/918125/ASPNet-Error-Specified-cast-is-not-valid/Thu, 30 May 2019 04:45:17 GMT