当用户输入时,我需要我的文本框自动完成.该值应来自数据库.我正在使用文本框的textchange属性.
protected void autocomplete(object sender, EventArgs e)
{
string query = "Select area,codes from tbl_pincode";
SqlConnection conn = new SqlConnection("Data Source=win2008-2;Initial Catalog=h1tm11;User ID=sa;Password=#1cub3123*;Persist Security Info=True;");
SqlCommand com = new SqlCommand(query, conn);
conn.Open();
SqlDataReader dr = com.ExecuteReader();
while (dr.Read())
{
zipcode.Text = dr.GetValue(0).ToString();
}
conn.Close();
}
Run Code Online (Sandbox Code Playgroud)
但我没有得到理想的结果.任何想法如何去做?
我有一张桌子:
user_id int Composite Unique (deal_id + user_id+deal_type).deal_id intdeal_type varchar.created_on datetime.这是我的桌子.我想在user_id列上创建唯一的复合,以便单个用户只能deal_id为每个用户创建唯一的deal_type.
如何在mysql phpmyadmin中创建复合唯一.
我在数据库中有两个列类型和名称.我想应用一个唯一约束,其中每个类型的名称都是唯一的.
Type Name
A ABC
R ABC
B ABC
Run Code Online (Sandbox Code Playgroud)
应该允许,而
Type Name
A ABC
A ABC
Run Code Online (Sandbox Code Playgroud)
不应该被允许
如何强制执行此约束,其中name在每种类型中都是唯一的?
谢谢,
我正在使用sql server.我有一张桌子
Company
ABC
XYZ
ABC,XYZ
Run Code Online (Sandbox Code Playgroud)
当我运行一个类似的查询时,where company like '%ABC%'我得到的记录只包含ABC而不是ABC,XYZ
如何获得这两个记录?
我想将tabhost的默认蓝色更改为红色.
<style name="AppTheme" parent="android:Theme.Light.NoTitleBar">
<item name="android:tabWidgetStyle">@drawable/tab_indicator_holo</item>
</style>
Run Code Online (Sandbox Code Playgroud)
tab_indicator_holo.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/tab_unselected_holo" />
<item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_selected_holo" />
<!-- Focused states -->
<item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/tab_unselected_focused_holo" />
<item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_selected_focused_holo" />
<!-- Pressed -->
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/tab_unselected_pressed_holo" />
<item android:state_focused="false" android:state_selected="true" android:state_pressed="true" android:drawable="@drawable/tab_selected_pressed_holo" />
<!-- Focused states -->
<item android:state_focused="true" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/tab_unselected_pressed_holo" />
<item android:state_focused="true" android:state_selected="true" android:state_pressed="true" android:drawable="@drawable/tab_selected_pressed_holo" />
</selector> …Run Code Online (Sandbox Code Playgroud)