309 Posted Topics

Member Avatar for nIcks123

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

Member Avatar for Reverend Jim
0
206
Member Avatar for poojavb

Is there a way to set Max date in Java for the calendar control or restrict the user from selecting the future dates?

Member Avatar for JamesCherrill
0
205
Member Avatar for poojavb

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 …

Member Avatar for poojavb
0
570
Member Avatar for carlos.barros.71

the attachments are not visible...could u please attach the images again....not in link format...

Member Avatar for poojavb
0
200
Member Avatar for mohana_61

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 …

Member Avatar for mohana_61
0
295
Member Avatar for poojavb

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 …

Member Avatar for poojavb
0
1K
Member Avatar for iEpic

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; …

Member Avatar for JamesCherrill
0
218
Member Avatar for poojavb

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 …

Member Avatar for poojavb
0
412
Member Avatar for hassan980

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 …

Member Avatar for Reverend Jim
0
284
Member Avatar for sanket044
Member Avatar for M.Waqas Aslam
0
136
Member Avatar for wallet123

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", …

Member Avatar for JamesCherrill
0
249
Member Avatar for kimlong2012
Member Avatar for M.Waqas Aslam
0
1K
Member Avatar for kimlong2012

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 …

Member Avatar for kimlong2012
0
425
Member Avatar for M.Waqas Aslam

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...

Member Avatar for M.Waqas Aslam
0
250
Member Avatar for poojavb

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 …

Member Avatar for TnTinMN
0
2K
Member Avatar for kimlong2012

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 …

Member Avatar for jezguitarist30
0
191
Member Avatar for annette_arpana3

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; …

Member Avatar for JamesCherrill
0
241
Member Avatar for kimlong2012

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()

Member Avatar for poojavb
0
115
Member Avatar for gahhon
Member Avatar for poojavb

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 …

Member Avatar for poojavb
0
825
Member Avatar for pae1800

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 …

Member Avatar for samsylvestertty
0
154
Member Avatar for dwinn

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

Member Avatar for dwinn
0
2K
Member Avatar for toomutch
Member Avatar for ravidaniweb

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

Member Avatar for poojavb
0
145
Member Avatar for skran

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 = …

Member Avatar for poojavb
0
1K
Member Avatar for joseluisvs

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....

Member Avatar for poojavb
0
206
Member Avatar for HibaPro

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 …

Member Avatar for poojavb
0
1K
Member Avatar for toomutch

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, …

Member Avatar for toomutch
0
2K
Member Avatar for themaj

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 …

Member Avatar for Reverend Jim
0
2K
Member Avatar for tracemic

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 …

Member Avatar for M.Waqas Aslam
0
177
Member Avatar for major_lost

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...

Member Avatar for TnTinMN
0
201
Member Avatar for jalpesh_007
Member Avatar for JamesCherrill
0
404
Member Avatar for Ella Jones

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....

Member Avatar for hericles
0
1K
Member Avatar for pandeysk_13

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 …

Member Avatar for G_Waddell
0
709
Member Avatar for m1234ike

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

Member Avatar for Reverend Jim
0
1K
Member Avatar for georgesk

If it is the connection string do mention the type of database u r using... Access SQl or something else....

Member Avatar for poojavb
-1
119
Member Avatar for poojavb

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 …

Member Avatar for poojavb
0
7K
Member Avatar for Dani

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 …

Member Avatar for TrustyTony
0
956
Member Avatar for skran

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 …

Member Avatar for poojavb
0
781
Member Avatar for deeps2_daniweb

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 …

Member Avatar for deeps2_daniweb
0
326
Member Avatar for Olifant
Member Avatar for lolafuertes
0
72
Member Avatar for Commando123
Member Avatar for Commando123
0
129
Member Avatar for Mike Bishop

mycommand.CommandText can also help u to return the entire query.....in ur debug.print.....

Member Avatar for poojavb
0
97
Member Avatar for mallikaalokam

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 …

Member Avatar for poojavb
0
150
Member Avatar for M.Waqas Aslam

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"

Member Avatar for poojavb
0
2K
Member Avatar for gahhon

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) …

Member Avatar for gahhon
1
158
Member Avatar for HibaPro

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...

Member Avatar for kvprajapati
0
116
Member Avatar for M.Waqas Aslam

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()

Member Avatar for M.Waqas Aslam
0
211
Member Avatar for shaanmugavel

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 …

Member Avatar for samsylvestertty
0
204
Member Avatar for Maj.Clac

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 …

Member Avatar for debasisdas
0
153

The End.