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.Write Inner Join in inline SQL Query in C# and VB.Net<p>Hi <a class="username" rel="chetan">chetan</a>,</p> <p>Refer below code.</p> <p><strong><span style="text-decoration: underline;">Code</span></strong></p> <p><strong>C#</strong></p> <pre class="brush: csharp">protected void Page_Load(object sender, EventArgs e) { using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings[&#34;constr&#34;].ConnectionString)) { string query = &#34;SELECT O.OrderId, O.ShippedDate, C.CompanyName, C.City FROM Orders O INNER JOIN Customers C ON O.CustomerId = C.CustomerId WHERE OrderId = @OrderId&#34;; using (SqlCommand cmd = new SqlCommand(query, con)) { cmd.Parameters.AddWithValue(&#34;@OrderId&#34;, 10643); con.Open(); cmd.ExecuteReader(); con.Close(); } } }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Using con As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings(&#34;constr&#34;).ConnectionString) Dim query As String = &#34;SELECT O.OrderId, O.ShippedDate, C.CompanyName, C.City FROM Orders O INNER JOIN Customers C ON O.CustomerId = C.CustomerId WHERE OrderId = @OrderId&#34; Using cmd As SqlCommand = New SqlCommand(query, con) cmd.Parameters.AddWithValue(&#34;@OrderId&#34;, 10643) con.Open() cmd.ExecuteReader() con.Close() End Using End Using End Sub</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/162963/Write-Inner-Join-in-inline-SQL-Query-in-C-and-VBNet/https://www.aspforums.net:443/Threads/162963/Write-Inner-Join-in-inline-SQL-Query-in-C-and-VBNet/Wed, 13 Mar 2019 06:02:40 GMT