"The data types text and nvarchar are incompatible in the equal to operator" in SQL Query
- by kenom
Why i get this error:
The data types text and nvarchar are incompatible in the equal to operator.
The field of "username" in database is text type...
This is my soruce:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="my_answers.ascx.cs" Inherits="kontrole_login_my_answers" %>
<div style=" margin-top:-1280px; float:left;">
<p></p>
<div id="question">
Add question
</div>
</div>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"
>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:estudent_piooConnectionString %>"
SelectCommand="SELECT * FROM [question] WHERE ([username] = @fafa)">
<SelectParameters>
<asp:QueryStringParameter Name="fafa" QueryStringField="user"
Type="String"/>
</SelectParameters>
</asp:SqlDataSource>