What do you have so far? post some code so we can help you out to fix it.
What do you have so far? post some code so we can help you out to fix it.
oh im sorry i think i misunderstood the point. When you said this "the second highest bid that is not the same user " the same user means the person who is actually log in the system?
try this
SELECT TOP 1 idCustomerBid, idProduct, bidAmount, bidDate
FROM bidHistory
WHERE (idProduct = 272) AND (idCustomerBid <> 2) AND (idCustomerBid NOT IN
(SELECT TOP 1 idCustomerBid
FROM bidHistory AS bidHistory_1
WHERE (idProduct = 272) AND (idCustomerBid <> 2)
ORDER BY bidAmount DESC))
ORDER BY bidAmount DESC
regards
Take out the * and try it.
in your select statement are you retrieving that value? if yes verify you have autogeneratecolumns to false you have to create a bound column manually for the primary field and also you can set the visible property to false if you do not want people look at it, in the background you still can reference that column.
I do not really sure if this is what you want but in aspx i do this.
foreach (Control cd in form1.Controls)
{
if (cd.GetType().Name == "TextBox")
{
TextBox txt = (TextBox)cd;
txt.Text = "hello";
}
}
regards
Ok, good to know.
take care.
at the end put DataGrid.DataBind()
also is your datagrid allow to generate the columns automatically, if not i would like to see the datagrid structure and the exact field you are retrieving from the calendar table
Regards.
Lets say that in the loadmain you set text for a label like this
Label1.Text = "Load Main"
But you want to do the same thing if you click a button, then create a function called for example
private void SetLabel()
{
Label1.Text = "Load Main"
}
then your load main will have this
private void LoadMain()
{
SetLabel()
}
and the button event
private void buttonevent()
{
SetLabel()
}
I hope you understand the idea. regards
Im not quite sure what is your problem, but did you try Response.Redirect(String URL);
Let's say you have a variable temp
Dim temp As String = "05/02/2005"
Dim ar() As String = temp.Split("/")
TextBox1.Text = ar(0)
The result of ar(0) is 05 i hope that help you.
The easiest way to do it is with a compare validator control <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="DropDownList2" ControlToValidate="DropDownList1" Type="Integer" Operator="LessThan" ErrorMessage="DropDownList2 must be greater than DropDownList1" Display="dynamic"></asp:CompareValidator>
DropDownList2 is the ToYr and DropDownList1 is FromYr
regards.
try use this dropdown.SelectedItem.Value
to retrieve the values from the drop down box.
regards.
Hi, i once have that problem and i use this function and it work for me.
http://geekswithblogs.net/AngelEyes/archive/2007/04/12/111504.aspx
Ok once you have a connection set up, the easiest way to go is using a dataset you can basically do this. i did not test this.
Dim statement As String = "SELECT EmployeeId, FName FROM tblEmployee"
Dim adapt As New SqlDataAdapter(statement,connection)
Dim ds As New DataSet()
connection.Open()
adapt.Fill(ds)
connection.Close()
CmbEmployee.DataSource = ds
CmbEmployee.DisplayMember = "FName"
CmbEmployee.ValueMember = "EmployeeID"
CmbEmployee.DataBind()
regards.
Good. take care.
Well partner in c# i will do this, probably you can translate this to vb.
System.Text.StringBuilder sbScript = new System.Text.StringBuilder("");
sbScript.Append("<script language='javascript'>");
sbScript.Append("var w=0, h=0;");
sbScript.Append("if(document.all || document.layers)");
sbScript.Append("{");
sbScript.Append("w=screen.availWidth;");
sbScript.Append("h=screen.availHeight;");
sbScript.Append("}");
sbScript.Append("var popW = 900,");
sbScript.Append("popH = 500;");
sbScript.Append("var leftc = ( w - popW) / 2,");
sbScript.Append("topc = (h - popH) / 2;");
sbScript.Append("window.open('");
sbScript.Append("http://www.google.com");
sbScript.Append("', 'w_Locate',");
sbScript.Append("'left='+leftc+',top='+topc+',width=900, height=500, menubar=yes, resizable=no');");
sbScript.Append("w_Locate.focus();<");
sbScript.Append("/script>");
ScriptManager.RegisterStartupScript(this, this.GetType(), "@@@@MyPopUpScript", sbScript.ToString(), false);
Hope that help you.
SELECT country_code, countries
FROM countries
WHERE (country_code NOT IN
(SELECT CountryCode
FROM allow))
ok so your statement should be like this.
regards.
Ok, I think I am a little lost lets put some data into that table
COUNTRIES
USA - UNITED STATES
DR - DOMINICAN REPUBLIC
MX - MEXICO
PR - PUERTO RICO
ALLOW
DR
MX
So what you are saying is that in ALLOW table you can have multiple DR and MX?
SELECT DISTINCT countries.Country_Code, Country_Name FROM countries INNER JOIN allow ON countries.Country_Code != allow.Country_Code ORDER BY Country_Name
What about that.
try this. SELECT DISTINCT countries.Country_Code, Country_Name FROM countries, allow WHERE countries.Country_Code != allow.Country_Code ORDER BY Country_Name
Regards.
Try that
SELECT Profiles.answer, users.gender, COUNT(Profiles.answer) AS count
FROM Profiles INNER JOIN
users ON users.userid = Profiles.userid
GROUP BY users.gender, Profiles.answer
Regards.
Let's go back to basic, you said before you had some virus and your pc, probably during the clean process you delete something that it is the culprit, is that is the case i will do a system repair if you have the cd.
Just to share some personal experience, once i had a similar problem with a mini dell, and i last 3 days working with a dell support guy and at the end, he just recommend me to make a fresh install, my lucky that computer is quite simple to backup, if it is not a really headache for you I will do the same thing.
Just a thought. take care.
shutdown any firewall on, in order to test.
Try reinstall the program.
reboot in safe mode with network and try to update.
Try to rename the application and try to update.
regards.
Hi, you should open the connection cn.Open() and then cn.Close() also you have a problem and the insert statement you are calling label1.text as lable1.text.
besides that check your table and see what is the minimum parameters that you need to insert.
also i will create another connection call it conn
sqlcmd = New Sqlcommand ( "Select * from Staff_Main where Staff_id like '"&textbox1.text&"'",cn)
cn.Open()
dr = sqlcmd.executereader
while(dr.read())
{
sqlcmd = new sqlcommand ("insert into smart.dbo.event(e_staff_name) values '"+dr.GetString(1)+"'",conn)
conn.Open()
sqlcmd.executenonquesry
conn.Close()
}
dr.Close()
cn.Close()
when you got the black screen did you try to press ctrl+alt+del and see what happen. if did go to windows task manager then file -> New Task (Run...) and type C:\WINDOWS\explorer.exe and click ok if that work check this thread http://www.daniweb.com/forums/showthread.php?t=39613&highlight=explorer.exe+not+starting
Just double check this, I am not sure. but when you say this For i As Integer = 1 To CheckBoxList2.Items.Count
I think the checkboxlist index start in 0.
You right :).
Make sure your dropdownlist does not have duplicate values, for example if you result set when you bind the sub category dropdownlist have a duplicate value, when postback is going to go back to first position because your value must be unique, verify that first and then tell us, what happened. to be more straightforward check this field M_PAGES_ID_PK when you bind the sub category dropdown.
Regards.
Glad to know you are in the road.
You can do this also replacing the textbox1.text in the insert statement by @name and so one and then add this line for every single parameter
cmdNcr.Parameters.Add("@name", SqlDbType.VarChar).Value = TextBox1.Text;
and so on.
Take care.
well if you cannot get into windows at all, try booting in safe mode, Press F8 at the beginning and select Safe Mode, If you can start your machine thru that, is there any recently software or driver update that you have installed, uninstall it, also run antivirus scan, do it step by step and try boot as normal.
Hope that help, if non report back how far can you get thru safe mode.
regards
well If you know how to make a connection with the database which i think you do, because you are getting data from the db. to insert a new record is much easier.
lets say that we have a table like this
Person
Name
LastName
Address
Dim insertStatement As String
insertStatement = "INSERT INTO Person (Name, LastName, Address) VALUES ('"+TextBox1.Text+"','"+TextBox2.Text+"','"+TextBox3.Text+"')"
Dim cmd As New System.Data.SqlClient.SqlCommand(insertStatement, Conne)
Conne.Open()
cmd.ExecuteNonQuery()
Conne.Close()
Which TextBox1.Text Contain the name or could be a string variable.
TextBox2.Text Contain the Last Name and TextBox3.Text the Address
And Conne is the connection already created.
hope that helps
regards.
Try this
Select a.SubCat_Name from SubCategory as a inner join category as b on a.SubCat_Cat_id = b.Cat_id
where b.Cat_name = '" & DirectCast(e.Item.FindControl("chkCategory"), CheckBox).Text & "'
I do not know if your really need DirectCast cause you are just asking for the checkbox label text which is string.
regards.
ok, i do not know if this is the best solution but it work.
I test this try to replace your statement in values, notice the event OnItemDataBound that makes the trick.
aspx
<table>
<asp:DataList ID="DataList1" runat="server" OnItemDataBound="bounditem">
<ItemTemplate>
<tr><td>
<asp:CheckBox ID="chkCategory" runat="server" Text='<% #DataBinder.Eval(Container.DataItem, "OPTION_FNCTN").ToString() %>' /></td><td>
<asp:CheckBoxList ID="ckhSubCategory" runat="server"></asp:CheckBoxList></td></tr>
</ItemTemplate>
</asp:DataList>
</table>
Now in the onload page i just generate the first checkbox which is the category one. notice in the select statement the function DISTINCT.
protected void Page_Load(object sender, EventArgs e)
{
string st = "SELECT distinct OPTION_FNCTN FROM MENUOPTS_T WHERE (OPTION_FNCTN <> '') ORDER BY OPTION_FNCTN";
DataSet ds = new DataSet();
SqlDataAdapter adap = new SqlDataAdapter(st, MyConn);
MyConn.Open();
adap.Fill(ds);
MyConn.Close();
DataList1.DataSource = ds;
DataList1.DataBind();
}
now i create another function while the datalist is bounded this is the function.
protected void bounditem(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
string stGet = "SELECT OPTION_DESC FROM MENUOPTS_T WHERE (OPTION_FNCTN = '"+((CheckBox)e.Item.FindControl("chkCategory")).Text+"')";
DataSet dsGet = new DataSet();
SqlDataAdapter adapGet = new SqlDataAdapter(stGet, MyConn);
MyConn.Open();
adapGet.Fill(dsGet);
MyConn.Close();
((CheckBoxList)e.Item.FindControl("chkSubCategory")).DataSource = dsGet;
((CheckBoxList)e.Item.FindControl("chkSubCategory")).DataTextField = "OPTION_DESC";
((CheckBoxList)e.Item.FindControl("chkSubCategory")).DataValueField = "OPTION_DESC";
((CheckBoxList)e.Item.FindControl("chkSubCategory")).DataBind();
}
}
i bet you there are a few ways to do this but, this is the first one that comes to my mind.
Regards
well i can tell you right now why.
you are retreiving category and sub category and the same resultset and your data is show as example.
Category Sub_Categor
Network CCNA
Network CCNP
Programming C#
Programming VB
and when you pass that to the datalist is going to embed the data as show above. and what you need is
Network CCNA
CCNP
Programming C#
VB
now are you doing that because somebody can select multiple sub_category at the same time?
I would say this
<td><asp:Checkbox ID ="cat_title_chk" AutoPostBack="true" runat="server" OnCheckedChanged="CheckChange" Text='<%# Container.DataItem("M_CATPAGES_CAT") %>'></asp:Checkbox> </td>
<td><asp:Checkbox ID ="chkSecond" runat="server" Text="Second CheckBox" Visible="False"></asp:Checkbox> </td>
Now in the source code i have this.
protected void CheckChange(object sender, EventArgs e)
{
CheckBox chk = ((CheckBox)sender);
DataListItem dlItem = ((DataListItem)chk.NamingContainer);
if (chk.Checked)
{
((CheckBox)title_dl.Items[dlItem.ItemIndex].FindControl("chkSecond")).Visible = true;
}
}
I hope that work for you regards.
Hi,
This code going into the dropdown event change, i think you are using 2003, im sorry i cant test this code in that version but in 2005 it work, hope that work for you.
string strJS = "";
strJS = "newwindow2 = window.open('URL','MyWindow','menubar=no,toolbar=no,status=no,scrollbars=no,resizable=yes,width=300,height=200');";
strJS += "newwindow2.focus();";
ScriptManager.RegisterStartupScript(this, GetType(), "alert", strJS, true);
Regards.
I do not really understand your point. because if you want to edit something and that is why you have a edit button, the row you working with should become textbox in order to edit something.
hi,
you need to set the MaintainScrollPositionOnPostBack in the aspx page <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" [B]MaintainScrollPositionOnPostback="true"[/B] %>
That is in vs 2005. in vs2003 i think is SmartNavigation="true"
Regards
i do this to get the current computer maybe look for something like this. Dim IPAddress as String = Request.ServerVariables.Get("REMOTE_ADDR")
that is vb, c# is almost the same.
Hi,
I do not know if this can help but try it
replace dr(0) for dr.GetString(0) and dr.GetString(1).
also try in the select retrieve exact the two fields that you want, i do not know what is the structure of your table. if that does not work try this
Dim cmd As New OleDbCommand("select * from login where id= '"+txtUser.Text+"' and pass='"+txtPwd.Text+"'", conn)
dr = cmd.ExecuteReader
if(dr.HasRows)
Form2.Show()
Else
txtUser.Clear()
txtPwd.Clear()
txtUser.Focus()
End If
try this
select ( select f.cycle as col1
from final as f
for xml raw, elements, type).query('for $col1 in (row/col1) return concat($col1, " ")')
I did not test this.
Regards.