309 Posted Topics
Re: Private Sub TextBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress 'accepts only numbers If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then e.Handled = True End If If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then e.Handled = False End If End Sub | |
Is there a way to set Max date in Java for the calendar control or restrict the user from selecting the future dates? | |
Hello, I want to implement Change Listener in the Action Listener of a Button I have a color graph chooser and 2 buttons...Apply and Cancel to select the color of the color chooser i have implemented the Change Listener but I want the change listener to act on the Apply … | |
Re: the attachments are not visible...could u please attach the images again....not in link format... | |
Re: using select statement and in the where clause mention the criteria as ur combo box....and in ur reader assign the value to the text box.... Try Dim myCommand As SqlCommand myCommand = New SqlCommand("SELECT * FROM tablename where studentname='" & Combobox1.Text & "'", Connection) Dim reader As SqlDataReader = myCommand.ExecuteReader … | |
Hello, Can we perform bulk insert for SQL data? I have the complete SQL data in text files. There are multiple tables and the corresponding text files. I tried to do the bulk insert but always got some new error. Please help me to get an answer. My code Imports … | |
Re: In case u need to loop even if the user enter correct number take ur if condition one place down.... import javax.swing.JOptionPane; // Needed for JOptionPane /** Chapter 3.1 Roman Numerals */ public class Chapter3dot1 { public static void main(String[] args) { int num; String input; boolean shouldContinue = true; … | |
Hello All, I have a Java program which is using a JOptionPane in it. eg. Are you sure u want to close the application? Yes No When I click with the mouse on the No button it works correctly but if I select the No button using the TAB key … | |
Re: when u click on the calculate button make sure that both the text boxes are not empty...if so prompt the error.... if textbox1.Text="" or Textbox2.Text="" then Msgbox("Mandatory Info") else 'ur calculation code End If below code u can do for entering only numbers....it has to be written in ur textbox … | |
| |
Re: May be u get some idea from here.... class constNumtoLetter { String[] unitdo ={"", " One", " Two", " Three", " Four", " Five", " Six", " Seven", " Eight", " Nine", " Ten", " Eleven", " Twelve", " Thirteen", " Fourteen", " Fifteen", " Sixteen", " Seventeen", " Eighteen", … | |
Re: Can u show ur code and what controls are u using to show ur record??? | |
Re: u can try the below code Public Function GetData() As DataView 'Open_DB_Connection() Dim SelectQry = "SELECT * FROM TableName" Dim SampleSource As New DataSet Dim TableView As DataView Try Dim SampleCommand As New SqlCommand() Dim SampleDataAdapter = New SqlDataAdapter() SampleCommand.CommandText = SelectQry SampleCommand.Connection = Connection SampleDataAdapter.SelectCommand = SampleCommand SampleDataAdapter.Fill(SampleSource) TableView … | |
Re: Union shud work and give the same alias name for all... SELECT DISTINCT FirstName as Name From HMS.dbo.DoctorRegister UNION SELECT DISTINCT LastName AS Name FROM HMS.dbo.DoctorRegister UNION SELECT DISTINCT FName As Name FROM HMS.dbo.InpatientDetails hope this is what u need... | |
Hello, Is it possible to disable the windows key when the application is running?? Suppose I am running a particular application....and if the user press the windows key or clicked on the windows key on the task bar it shud prompt a message box that user is not allowed to … | |
Re: Just an idea... I had to save the data as INP1 - first 3 characters and last integer We cant save the alphanumeric as integer but what I had done was....I had one temp table....which had the integer value... every time I need to increment the value I used to … | |
Re: u can create a class for the string characters only once and then call the class for the particular control in ur full project whenever required... like below import java.awt.*; import java.awt.event.*; import javax.swing.*; public class MyTextField extends JTextField implements KeyListener,FocusListener { int size; public MyTextField(int size) { super(20); this.size=size; … | |
Re: Dim myCommand As SqlCommand myCommand = New SqlCommand("SELECT StaffCode,StaffName,Gender FROM Staff WHERE StaffCode='" & Me.txtStaffCode & "'", cnn) Dim reader As SqlDataReader = myCommand.ExecuteReader If reader.HasRows() While reader.Read 'txtStaffCode.Text = reader("StaffCode") txtStaffName.Text = reader("StaffName") cboGender.Text = reader("Gender") End While Else MsgBox("No record found.","Not Found") End If reader.Close() | |
Hello Friends, Can anyone tell me how to find the list of SQL servers on the local machine...and not the network... I searched in google but everywhere its for the list of SQL servers on network....I just want my PC SQL server name.... Is it possible to get it? Thanks … | |
Re: When ur application starts for the very first time allow the user to save the database location in a particular text file.... for that u have to give the openfiledialog box that will take the file location and save the location.... so that during the connection u can get the … | |
Re: as u are also using asp.net the show method dont go with it.... response.redirect is the method to redirect it to the other form in asp.net | |
| |
Re: ur insert query is also incorrect with the quotation marks SqlCommand sqlcmd = new SqlCommand("INSERT INTO TABLE1 (Name, Address, Email, Phone, Dob) VALUES ('"+nametbox.Text+"','"+addtbox.Text+"','"+mailtbox.Text+"','"+phonetbox.Text+"','"+dobtbox.Text+"')"); if ur are not using the parameters | |
Re: Hope this helps u.... 'Open Connection Dim myCommand As SqlCommand myCommand = New SqlCommand("SELECT ProdName from HMS.dbo.Product where Inventory < ReorderLimit", Connection) Dim reader As SqlDataReader = myCommand.ExecuteReader While reader.Read() For RCnt As Integer = 0 To dgvInventory.Rows.Count - 1 If dgvInventory.Rows(RCnt).Cells("Product").Value = reader("ProdName") Then dgvInventory.Rows(RCnt).DefaultCellStyle.BackColor = Color.MediumPurple dgvInventory.Rows(RCnt).DefaultCellStyle.ForeColor = … | |
Re: What do u actually want to do in ur coding??? set the combo box value for 1 combox and then on the selection change event get the remaining values.... if I am wrong then can you be little more clear.... | |
Re: Something like this might help u... 'Open_DB_Connection Try Dim myCommand As SqlCommand myCommand = New SqlCommand("SELECT * FROM Tablename where ID='" & combobox1.Text & "'", Connection) Dim reader As SqlDataReader = myCommand.ExecuteReader While reader.Read txtID.Text = reader("ID") txtName.Text = reader("Name") txtCost.Text = reader("Cost") End While reader.Close() Catch ex As Exception … | |
Re: try something like this set the y axis of the datagridview as u want.... u can also write the below code in load as well as form resize event so that if the form is resized even the controls will be resized... DataGridView1.Size = New System.Drawing.Size(Me.Width / 2 - 100, … | |
Re: Try this...keep the form 2 code as it is.... Imports System.IO Public Class Form1 Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then Dim dbfFileFolder As String = OpenFileDialog1.FileName Dim stFileName As String Dim MyFile As FileInfo = New FileInfo(dbfFileFolder) stFileName = MyFile.Name If … | |
Re: u can write in the textbox textchange event with the sql query using the like condition.... 'Open Connection Try Dim myCommand As New OleDbCommand With myCommand .CommandText = "SELECT ID , (FirstName +' '+LastName) as Name FROM TableName where ID like '" & Textbox1.Text & "%" + "' order by … | |
Re: According to ur code u r creating the new instance of the FormX and then checking the condition..... if u know the form name then just give the name and then the condition...dont create an instance... | |
Re: What is ur program actually doing??? what is present in the csv file?? | |
Re: the line variable u have declared inside ur do while loop and calling until the line variable is nothing.... declare the line variable before the do while loop.... > Dim line As String() = Split(wholeingrediant, ",") Make sure that the user enters only numeric values wherever required.... | |
Re: Just an info.... Actually ur sql query wont help u.... if u select the first "01" from sessionID , second "02" from courseID , third "02" from levelID then the database would store something like **01020200001** suppose u have selected the first "01" from courseID and when u run the … | |
Re: The below code will help u to change the file extension... Dim myFiles As String() myFiles = IO.Directory.GetFiles("D:\", "*.txt") Dim newFilePath As String For Each filepath As String In myFiles newFilePath = filepath.Replace(".txt", ".html") System.IO.File.Move(filepath, newFilePath) Next | |
Re: If it is the connection string do mention the type of database u r using... Access SQl or something else.... | |
Hello Friends, I need help to disable the parent window form as soon as the user will open the child form.... for eg...consider daniweb...when we click on member login the background form gets grayed out.... Disabling the form is not the option cause it will just disable all the controls … | |
Re: Could you please tell how the reputation points increases??? Even after posting threads to help our daniweb friends or when others mark the thread as solved or even vote us up I dont find my reputation point increasing.... There is a joy within us when we see that the thread … | |
Re: whatever waqasaslammmeo has given that is correct.... what else do u want to display in ur datetimepicker??? by setting the format to time and setting the showupdown property as true the calendar should not drop down.... what do u mean by changing time....the up down buttons will change the time...even … | |
Re: You want to search the employee on basis of date and month.... so u have to modify ur query accordingly.... select ID, FName, MobNo, Email, BirthDate FROM Tablename where Day(BirthDate) = day(GETDATE()) and month(BirthDate) = month(GETDATE()) ur getdate() should be according to the datetimepicker date and month value.... hope it … | |
Re: can u be more clear....how many textboxes will u be having | |
Re: Post ur code so that we can find out where u r going wrong.... | |
Re: mycommand.CommandText can also help u to return the entire query.....in ur debug.print..... | |
Re: Right click on ur database and select add new database....ur new database will be different...it wont be added in ur system database... after ur database is created right click and then select new table to add ur data.... ur tree view in database will be Servername Database - System Databases … | |
Re: If you would have been storing the file path then you could have used the following code Dim img As New DataGridViewImageColumn() Dim inImg As Image = Image.FromFile("C:\Users\pooja\Desktop\images\abc\Logo.jpg") img.Image = inImg DataGridView1.Columns.Add(img) img.HeaderText = "Image" img.Name = "img" | |
Re: In the key press event of the text box try writing the below code....it will allow user to enter only number and when the user will enter alphabet or any other characters it wont allow user to enter it.... 'accepts only numbers If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) … | |
Re: Check your database connection.... When you want to test first see that the result is visible in your main report preview window.... show the code if you have added... | |
Re: As soon as u create the file, it is in open state....u need to close the object of the file and then try to load the data... FileClose() | |
Re: To take back up in .bak extension file 1. Right click on ur database name 2. Tasks -> back up -> Set the backup location and then click on OK. To restore the .bak extension file 1. Right click on ur database name 2. Tasks ->Restore -> Database 3. Set … | |
Re: Login form is different and user registration is different Login form- Create a form with the basic requirements like two labels as username and password.... two textboxes for entering username and password three buttons for login, closing form and one for reset.... Make the database connection.... Validate if the user … |
The End.