Hello, Recently I am starting to code my scripts in PDO method to manage the information in a mysql database. In this case I am having an issue how to use the best practice conditions when dealing with a POST **int** value. With the posted values I am making a select query, a short version of it is as follows if( isset($_POST['gjendja_id']) ){ $gjendja_id = intval($_POST['gjendja_id']); if( $gjendja_id > 0 ){ $gjendja_id = $_POST['gjendja_id']; }else{ $gjendja_id = 'IS NOT NULL'; } }else{ $gjendja_id = 'IS NOT NULL'; } The query that would be executed try { $counter = 1; $response …

Member Avatar
Member Avatar
+0 forum 7

I have a multicolumn listview. There are three button Add, delete and Updata. List is working fine, it add, delete and update list data. But i want to save every row inside listview when i click save button. Bellow is my XAML. <TextBox Canvas.Left="12" Canvas.Top="12" Height="23" Name="textBox1" Width="120" TextChanged="textBox1_TextChanged" KeyDown="textBox1_KeyDown" GotFocus="textBox1_GotFocus" /> <TextBox Canvas.Left="146" Canvas.Top="12" Height="23" Name="textBox2" Width="120" TextChanged="textBox2_TextChanged" GotFocus="textBox2_GotFocus" KeyDown="textBox2_KeyDown" /> <ListView Canvas.Left="12" Canvas.Top="68" Height="183" Name="listView1" Width="253" SelectionChanged="listView1_SelectionChanged" SelectionMode="Single"> <ListView.View> <GridView> <GridViewColumn Header="Col1" Width="150" DisplayMemberBinding="{Binding Col1}"></GridViewColumn> <GridViewColumn Header="Col1" Width="50" DisplayMemberBinding="{Binding Col2}"></GridViewColumn> </GridView> </ListView.View> </ListView> <Button Name="addButton" Canvas.Left="122" Canvas.Top="41" Height="21" Width="69" Click="addButton_Click" IsDefault="True">Add</Button> <Button Name="removeButton" Canvas.Left="197" Canvas.Top="41" Height="21" Width="69" Click="removeButton_Click">Remove</Button> …

Member Avatar
+0 forum 0

Hey good people, I hope you are all well. Ok so here is the scenario, i have 4 tables that i have made in sql server 2008. I am using a drop down menu to diplay their names. Like this... ![ecb53783b16f2f19f927a3cd72bee4d0](/attachments/large/4/ecb53783b16f2f19f927a3cd72bee4d0.png "ecb53783b16f2f19f927a3cd72bee4d0") I am going to use a dataGrid view. What i want to do is that when i select a department name from the drop down, it's table content shows up in the gridview that i can apply Datebase operations on, like add, edit, refresh and delete etc. I don't want to make seperate gridviews for each table. Is …

Member Avatar
Member Avatar
+0 forum 1

I have a textbox and a label bound to the same member via a bindingsource. I would have expected that at some point when the user changes the textbox, the label would be refreshed, yet it is not. What am I missing here?

Member Avatar
Member Avatar
+0 forum 2

The following snippet shows how you can use binding in your queries when using MySQLi. For starters, here's the table structure I've used: CREATE TABLE `mytable` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `dob` date DEFAULT NULL, `level` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; The snippet shows how to use binding for an INSERT and an UPDATE query. The same method can be used for a SELECT. Note that you can only use it to bind values to a query, you cannot use this to dynamically insert …

Member Avatar
Member Avatar
+3 forum 2

I'm trying to dynamically populate a cfselect with a CFC using binding. Here's my cfc <cfcomponent output="false"> <!--- set function name ---> <cffunction name="Get_Companies" access="remote" returnType="array"> <!--- Define array to produce the drop down ---> <cfset var data=""> <cfset var result=ArrayNew(2)> <cfset var i=0> <!--- Get data ---> <cfquery name="data" datasource="NewMediaIntranet"> SELECT * FROM Companies Order by CompanyName </cfquery> <!--- Convert results to array ---> <cfloop index="i" from="1" to="#data.RecordCount#"> <cfset result[i][1]=data.Company_ID[i]> <cfset result[i][2]=data.CompanyName[i]> <!--- determine which is selected via what you passed and something in the database ---> </cfloop> <!--- And return it ---> <cfreturn result> </cffunction> </cfcomponent> And here's …

Member Avatar
+0 forum 0

Hi, I have a class called "car" with - I have no ideia how to say this in english - "data members" as the following: Public pneu As classDoor Public mat As classTire Public length As Double And so on. All the related classes have null constructors. I have a tab control where each tab is equivalent a one of this features. The tab "Tire" with respect to "pneu", for example, has the following properties: Public Property materialh As String() Set(value As String()) mat = value End Set Get Return mat End Get End Property Public Property diameterh As String() …

Member Avatar
Member Avatar
+0 forum 5

Hi, I have a tabcontrol with 3 tabs. Every tab has a great deal of textboxes which I use to refresh the properties of an object. To save my time, I bind the textboxes.Text to the properties of my object. The main problem happens 'cause I can make the binding just when the properly tab is selected. The thing is there is no need to walk through the tabs sometimes, cause my Object can be deserialized, so I may want to perform the calculations whitout even having to fill all the textboxes. In other words, sometimes I won´t select all …

Member Avatar
Member Avatar
+0 forum 6

The following snippet shows how you can use binding in your queries when using PDO. For starters, here's the table structure I've used: CREATE TABLE `mytable` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `dob` date DEFAULT NULL, `level` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; The snippet shows how to use binding for an INSERT and an UPDATE query. The same method can be used for a SELECT. Note that you can only use it to bind values to a query, you cannot use this to dynamically insert …

Member Avatar
+3 forum 0

I have a combobox that is bound to a DB and works great. However, when the user adds a value to the table to which the combobox is bound, the combobox keeps the old value and adds the current items in the table. In this case the table originally held just one record ("2012"). The user added 2013 so the table now shows two records ("2012" and "2013"), but the combobox shows three records ("2012", "2012", and "2013"). UNTIL I exit the app and restart, in which case it correctly reflects the only two records in the table ("2012" and …

Member Avatar
Member Avatar
+0 forum 2

Seems like this should be simple. I am binding comboboxes successfully to my Access DB. It looks like this: Dim da As New OleDbDataAdapter(asql, con) Dim ds As New DataSet da.Fill(ds) cboEmployeeNumber.ValueMember = "ID" cboEmployeeNumber.DataSource = ds.Tables(0) cboEmployeeNumber.SelectedIndex = 0 Works great. Then I try to bind a text box and I get any number of errors based on which version I try. I feel like I am going about this the wrong way. Below are some of the variations I have tried without success: txtTypeOfEvaluation.Text = "Classification" txtTypeOfEvaluation. = ds.Tables(0) txtTypeOfEvaluation.DataBindings.Add("Text", ds, "2013Employees.Classification") txtTypeOfEvaluation.DataBindings.Add("Text", ds, "Employees.Classification") Me.txtTypeOfEvaluation.DataBindings.Add("text", ds.Tables("Employees"), "Classification") …

Member Avatar
Member Avatar
+0 forum 1

Hi all. I am using Microsoft Visual Web Developer C# and am working with a database. I am using 2 tables: CONTINENT table with fields: CONTINENT_CODE and CONTINENT_NAME The other table is COUNTRIES with fields: COUNTRY_CODE and COUNTRY_NAME The 1 dropdownlist is bound to the CONTINENT table and displays the CONTINENT_NAME (with its value CONTINENT_CODE) The 2nd dropdownlist is bound to the COUNTRY TABLE and displays COUNTRY_NAME (with its value COUNTRY_CODE). Now my question is what should you do in order for when a user selects Europe, England appears in drop down list and not China (vice a versa). Thanks

Member Avatar
Member Avatar
+0 forum 1

Hi, i am making an asp application and in code behind file i am trying to bound drop down list from tbl_teacher in which i concatenate the first and last name by this query `string sqlStatement = "SELECT teacher_id, fname + lname AS Name FROM tbl_teacher";' and it is working fine i got the drop down selected text as the names of the teachers and always "1" as the selected value but i want the selected value as the teacher's ID from tbl_teacher i am using following code if (dt.Rows.Count > 0) { ddl_TeacherName.DataSource = dt; ddl_TeacherName.DataTextField = "Name"; ddl_TeacherName.DataValueField …

Member Avatar
Member Avatar
+0 forum 2

I have been tryin to get this to work for the past week if not two >:( with no joy. Worst of all its such a trivial problem. The program asks you to choose a town name from a combo box when you choose the location you shoud be brought to a brand new Jframe with a populated Jtable. Now everything does what its meant to do except the jframe window which opens as the border of the window and the minmise,maximise and close buttons. You can view the database by expanding the jframe window from the bottom right corner(Click …

Member Avatar
Member Avatar
+0 forum 7

I am building a chat application based on websocket protocol.I am uploading this on an apache server and i am getting this error : "Warning: socket_bind() [function.socket-bind]: unable to bind address [98]: Address already in use" I am using port no. 12346. When i checked this port's status i got "12346 is not responding". I have checked many ports on my remote server ,none of them is responding.So please tell me how to check if there is a usable port which i can use?? I have also used port 80 and 443 but i am getting the error : Permission …

Member Avatar
Member Avatar
+0 forum 2

Hi I'm coding in C++ XAML to make a windows 8 store app. Now, there are two objects in my main window: a textBox and a textBlock. What i want to do is that the user will write an equation in the textBox and the textBlock will show all the literals in that equation. The textBlock should keep updating as soon as the user changes the data, without the user pressing enter or clicking another button or something. What i'm trying to do is, the Text in the textBlock will be equal to a string that the function "return_literals" returns. …

Member Avatar
+0 forum 0

Hi All, Just to say that I've searched DW and Google extensively before posting here. Also looked at the jQuery site, but failed to find exactly what I'm looking for. Anyway here's the thing: I have a button on a form, that when it's pressed inserts some new inputs (textboxes) to the form. Then another button should copy the contents of the first of these inputs to all the others. Now, this is tricky, js tells me that these inputs are undefined, presumably as they are added after page load. I've looked at .bind(), .delegate(), .live() and .on(), but can't …

Member Avatar
Member Avatar
+1 forum 2

I have a datagridview bound to a datatable and it works great. However, when I try to programmatically change the datasource property to a different existing table, I get a blank datagridview with no cells. Although I have tried many bits of code to remedy the problem, this is the one that I felt should do the trick: dgvThresholds.DataSource = SquirrelDataSet.Tables("Threshold market 12") ThresholdMarketTableListTableAdapter.Update(SquirrelDataSet.Tables("Threshold market 12")) dgvThresholds.DataSource = ThresholdMarketDefaultBindingSource dgvThresholds.Refresh() Any advice on how to get this thing to work? Seems simple...

Member Avatar
Member Avatar
+0 forum 3

Dear All, With help from you all, I have a successful instant search on the current draft of our website. I'd love help with three minor issues of following convention: 1) Clicking on your link of choice brings about its appearance in another window -- that makes going back difficult and confusing. What can I do to add to the script (or php) to make the new link appear in the same window? 2) At the moment, to move out of the search box and down the list of choices one uses the tab key (or even worse the shift-tab …

Member Avatar
Member Avatar
+0 forum 8

Write a Python program that draws a circle with radius 50 pixels and centered at the center of the canvas. Give the canvas white background color and make it expand with its frame whenever the user resizes the frame. The program will respond to some mouse and keyboard events as described below. Whenever the left mouse button is pressed, display a message indicating whether the mouse pointer is inside the circle as shown in the figures below. The center of the message's baseline should be at the center of the circle. Moreover, the message should be displayed using a random …

Member Avatar
Member Avatar
+0 forum 3

Dear Everyone, I have a functional instant search (in draft at [Click Here](http://www.woofwoofwoof.org/is08/search.htm)). I want the search to function very similarly to Google. This will help sighted people figure it out, and bring me much more in compliance with accessibility standards. Unfortunately, I'm missing two "Google-oid" features: . 1) **How do I get the arrow keys to move the focus up and down?** In Google, **up and down arrows** allow you to move from inside the input box all the way down to the last choice (without recycling); I already have the **enter keydown** making the executive the link in …

Member Avatar
Member Avatar
+0 forum 1

Hi I have a vb.net form connected to an access database using vb.net .All my other button except for the add new button If Valid = True Then CustomerBindingSource.AddNew() Me.TableAdapterManager.UpdateAll(Me.DB_ShopDataSet) End If I want this code to add a new row to the customer table.However the current code modify the content of the first row in my table instead of adding a new one I really need help guys Please reply soon Thanks

Member Avatar
Member Avatar
+0 forum 1

Hello. I recently finished my 1. semester in Computer Science, and got a good fundamental idea on programming in Python. Our exam assignment whas to create a game where we had to smash robots by clicking around with the mouse. The GUI was provided by our instructor. Now we newer learned about binding, but now that the class is finished, i really want to know how this is possible to do. I found this code on the internet: from tkinter import * root = Tk() listen = [] def key(event): print ("pressed", repr(event.char)) listen.append(event.char) def callback(event): frame.focus_set() print ("clicked at", …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have a php file that contains the queries as strings. I have wrote the following query: SELECT message_no, sender, destination, time_received, type, reference_no, message FROM messages WHERE message LIKE '%:substring%'; :substring is then assigned a value from $substring. The query works when i run it directly in cmd however it does not work within the php web application. All messages with the substring value within $substring should be displayed. I believe there must be a problem with this part: '%:substring%' Any help would be much apprieciated.

Member Avatar
Member Avatar
+0 forum 2

I have two Combo Boxes..1-Programme 2-Semester I want to bind Semester combo box with Programme combo box.. i m reading file from Xml.... after binding i have to show data on datagrid view... but i m not able to do it...... i hope someone will help me... Regards.. Farhad

Member Avatar
Member Avatar
+0 forum 2

Hi all, Hopefulle someone outthere can help me identify whay i'm doing wrong. I'm sure it's something simple I have overlooked. I have the following templates in my xaml. [CODE] <Window.Resources> <DataTemplate x:Key="ModuleTemplate" > <StackPanel Orientation="Vertical"> <TextBlock Text="{Binding Path=fileName}"/> <TextBlock Text="{Binding Path=baseAddress}"/> <TextBlock Text="{Binding Path=entryPointAddress}"/> </StackPanel> </DataTemplate> <HierarchicalDataTemplate x:Key="ProcessTemplate" ItemsSource="{Binding Path=Modules}" ItemTemplate="{StaticResource ModuleTemplate}" > <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=id, StringFormat=Pid \{0:d4\}}"/> <TextBlock Text=" - "/> <TextBlock Text="{Binding Path=processName}"/> </StackPanel> </HierarchicalDataTemplate> </Window.Resources> [/CODE] The tree view is defined in xaml [CODE]<TreeView x:Name="tv_Processes" ItemsSource="{Binding}" ItemTemplate="{StaticResource ProcessTemplate}" />[/CODE] I have made 2 classes AProcess and AModule[CODE] class AProcess : INotifyPropertyChanged { private string …

Member Avatar
Member Avatar
+0 forum 1

Hi I need some help over here... how do i change the display member of a ComboBox after i have entered a code in a textbox that it represent the combobox value?? example Code: 02-001 Combobox: Provider X if i change the code the provider combobox must change and if i change the provider combobox the code should change!.. i haven't found any help.. heres little code I remember [CODE]if e.keychar = chr(13) Then combobox.valuemember = textbox.text combobox.displaymember = me.stockdataset.selectprovider(@textbox.text) end if[/CODE] this code change the combo box display member but if I change the comobox by clicking it the …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone :) Title says it all... I'm trying to bind events to a wx.GenericDirCtrl. I've visited more than 20 web sites but i haven't found how to do it. I've tried different manners but it doesn't work as i expect it to. In some case my control is seen as a normal TreeCtrl and i can't use with it the GetFilePath method of the GenericDirCtrl ([URL="http://www.wxpython.org/docs/api/wx.GenericDirCtrl-class.html"] docs/api/wx.GenericDirCtrl-class[/URL]), in other case i can't get all the path of the selected file and folder in the tree, GetFilePath gives just the name... Help me please to make it do its job! …

Member Avatar
Member Avatar
+0 forum 2

HELP!! I try to bind a textbox to a datatable but i cant.. I checked if the datatable is filled (it includes the results of a sql query)and it s ok.. i can depict the result in a combo box but not in textbox. I wait for only one result that s why i need textbox instead of combo.. that s my code.. i m desperate .. [CODE]Dim StateTable As New DataTable StateTable.Clear() ' Dim ds As New DataSet Dim sqlCmd As New SqlCommand("select DISTINCT State_LCL from T_MUNICIPALITY,T_MUNICIPALITY_STREETS where T_MUNICIPALITY.Municipality_LCL=T_MUNICIPALITY_STREETS.Municipality_LCL and T_MUNICIPALITY_STREETS.Municipality_LCL='" & txtMunicipality.Text & "'", conn) Dim StateDA As …

Member Avatar
Member Avatar
+0 forum 4

Hello, I have 2 tables: news and users news - N_id (primary) - title - article - time - U_id users - U_id (primary) - member I have managed to create the gridview with edit/add/delete for news only, without incorporating the users who wrote that news article. My question here is how can I add a column for the member in the main gridview so that whenever I add a new row, I can select a member (id) to go along with the article.

Member Avatar
Member Avatar
+0 forum 1

The End.