309 Posted Topics
Re: Open file dialog box has a property to open multiple files `openFileDialog1.Multiselect = true` | |
Re: What kind of database is it?? Access, MSSQL or MYSQL? I derived a query in Access hope ur colname is a datetime field SELECT * FROM tablename WHERE (format(colname,"yyyy")<Year(Now())-4); | |
Re: Is there a function to hightlight some particular word in our comment...as it was earlier green/red??? | |
Re: Process.Start("exeprocessname","filename") eg. `Process.Start("Notepad.exe","C:\text.txt")` | |
Re: First declare the variables and then when u will use the select query make use of reader that will read the value and assign it to the variable eg Dim docid as String Dim docfname as String Dim doclname as String 'connection string Try Dim myCommand As OleDbCommand myCommand = … | |
Re: Try this.... Dim i As Integer i = DataGridView1.CurrentRow.Index 'then use the insert query with the parameters like DataGridView1.Item(0, i).Value 'cell value keeps on changing for all cells | |
Re: what does the searchdatas() function do??? it is not mentioned in the code??? try to write the below code in Textbox change event rather than button click and see open connection first Try Dim myCommand As New SqlCommand With myCommand .CommandText = "SELECT * FROM tablename where columnid like '" … | |
Re: first there shud be an insert query to move ur records to the other table and then an update query eg.` insert into newtablename(col1, col2, col3) select col1,col2,col3 from oldtablename` and then an update query based on userid update oldtablename set count=value1,times=value2 where user_id="STEVE20" hope it helps u | |
| |
Re: This worked fine Dim date_now As Date date_now = DateTime.Now Debug.Print(date_now.ToString("yyyy/MM/dd HH:mm:ss")) | |
Re: I would go with u both Mitja and Unhnd but what if we give the code in specific format like if we tell the user to enter the date suppose **yyddmm** format and on validating event check and then convert the date....if not possible print error msg and if correct … | |
Re: is the value coming from database??? where are u saving the maximum number??? if the value is coming from database use a select query select max(columnname) from tablename 'columnname shud be the one which will be unique and incrementing after that whatever value u will get convert it to Integer … | |
Re: Make sure that the xyz = Mid(lstboxstudents.SelectedItem, 1, 8) has atleast 9 characters in it.... Dim con As New OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0;" & "Data Source = Decisionmaths.mdb") Dim xyz As String xyz = Mid(lstboxstudents.SelectedItem, 1, 8) Dim sqlx As OleDbCommand con.Open() sqlx=New OleDbCommand("SELECT * FROM Student WHERE StudentNumber = '"+xyz+"'",con) … | |
Re: What is the issue u r facing in this??? please explain in detail | |
Re: I have done the connection but by providing modules...check if it helps u... 1. for ms access Imports System.Data.OleDb Module DBConnection Public Connection As OleDbConnection = New OleDbConnection() Public Function Open_DB_Connection() As String Try Dim EntireFile As String = Application.StartupPath & "\HMS.mdb" Connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0.; " & "Data Source=" & … | |
Re: I tried one method.... Assuming u will have a datetimepicker that will show the due date / it can be a label or text box also just to store the value One label or textbox that will have a due Amount/per day that needs to be paid last the result … | |
Re: For 4th query SELECT distinct first_name,last_name, sum(total_price) FROM Customer, Order WHERE Customer. customer_id=Order.customer_id AND customer.customer_id=87162412 group by first_name,last_name For 5th query select Customer.customer_id, first_name,last_name from Customer, Order WHERE Customer.customer_id=Order.customer_id group by customer.customer_id,first_name,last_name having sum(total_price)>5000 | |
Re: if ur r using vb.net professional than see whether u have the crystal report installed in ur machine...then u will be able to get the crystal report viewer and will also be able to make the reports easily.... | |
Re: I guess u want to display the username from the login form to main form after successful login, am i RIGHT?? if txtUsername has the text for username then while calling the second form u can write as below 'this code is to be written in in form1 before calling … | |
Re: I have done the same thing for username and password...check if it works for u Why do u write the Item(1) code cant it be just written with reader name and quote brackets column name? `reader("DrName")` if ur case sensitivity code is creating error then check below Try Dim myCommand … | |
Re: But shud I ask u y do u need a datatable if u can login without it??? check my below code Try Dim myCommand As OleDbCommand myCommand = New OleDbCommand("SELECT * FROM userlogin where UserName='" & txtUsername.Text & "' and Password='" + txtPassword.Text + "'", Connection) Dim reader As OleDbDataReader … | |
Re: while loading the crystal reports pass the database connection along with the username and password and then try to call the crystal report... Dim crtableLogoninfos As New TableLogOnInfos Dim crtableLogoninfo As New TableLogOnInfo Dim crConnectionInfo As New ConnectionInfo Dim CrTables As Tables Dim CrTable As Table Dim cryRpt As New … | |
Re: Dim Avail As String = rid.Item(4) what is Item(4) ...u shud write `Dim Avail As String=rid("columname")` and check | |
Re: I had a code for this...but I was having a text box will tells the interval... Suppose the doctor starts his day at 9 am morning and ends at 6pm evening and the appointment interval is 30 mins then the result will be displayed in one combo box with the … | |
Re: While entering record in combo box make sure that it validates the count Dim countvalue as Integer countvalue=combobox1.Items.Count if countvalue>60 Msgbox("Count cannot exceed 60") else 'code to add the record in combobox End If Hope it helps u... 'Sorry I guess I did not understand the requirement....extremely sorry | |
Re: Mitja - is this a VB.net code??? | |
Re: u can use the below code this code shud be written in form1 where u will redirect it to form2 form2.txtName.Text = txtUsername.Text Form2.show() else u can use the below code in ur form2 load event txtName.Text = form1.txtUsername.Text | |
Re: u can use the count function in the select query, if the count returns more than sixty values then prompt the message... Dim temp as Integer Try Dim myReader As OleDbDataReader Dim sql As String = "SELECT count(*) as total from tablename where Section='" + combobox1.Text + "'" Dim comm … | |
Re: Dim di As New IO.DirectoryInfo("Your directory path") Debug.Print("di: " + di.ToString) Dim diar1 As IO.FileInfo() = di.GetFiles() Dim dra As IO.FileInfo 'list the names of all files in the specified directory For Each dra In diar1 lstFiles.Items.Add(dra) 'all files present in the directory are viewed in list box Next hope … | |
Re: Add paranthesis and use the OR instead of AND and see if it works...if u r grouping it means it has to fulfill the condition... | |
Re: What does ur combobox1 contains and what is in combobox3 Private Sub ComboBox3_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ComboBox3.Validating If ComboBox3.Validating Then con = New OleDbConnection("Provider= Microsoft.ACE.oledb.12.0; Data Source=C:\Users\edenzam\Desktop\CBFMNHS Enrollment System\CBFMNHS Enrollment System\bin\Debug\Enrollment System.accdb") Dim ewaaa As String = "Select * from SchedulingTwos where YearLevels = '" … | |
Re: The separator value takes the year value as whenever ur will enter any other format for date except for separator as "," it will show the error and the error is at where u have initialized year... add the try catch block before the initialization as below and check one … | |
Re: Another approach is to validate the input string before performing the conversion using Java regular expression. I like that second approach because it is more elegant and it will keep your code clean. public boolean isInteger( String input ) { try { Integer.parseInt( input ); return true; } catch( Exception … | |
Re: Dim abc As String abc = TextBox4.Text If abc = "" Then MsgBox("Empty") Else If ListBox1.FindString(abc) <> True Then MsgBox("Got it") Else MsgBox("Not") End If End If | |
Re: try using `Date.Today` instead of using `My.Computer.Clock.LocalTime.Date` | |
Re: try using `Date.Today` instead of using `My.Computer.Clock.LocalTime.Date` | |
Re: Enter the correct cell no and then on the click of the row in datagrid view u will get the cell value in the text box textbox1.Text = DGS4.CurrentRow.Cells(0).Value | |
Re: try the below one Private Sub ComboBox3_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ComboBox3.Validating If ComboBox3.Validating Then con = New OleDbConnection("Provider= Microsoft.ACE.oledb.12.0; Data Source=C:\Users\edenzam\Desktop\CBFMNHS Enrollment System\CBFMNHS Enrollment System\bin\Debug\Enrollment System.accdb") Dim ewaaa As String = "Select * from SchedulingTwos where YearLevels = '" & ComboBox1.Text & "'" com = … | |
Re: Whenever u write a coding for Database connection use the try catch block Try ' *ur complete code goes here * Catch ex as Exception MsgBox(ex.Message) ' if u get an error in above coding it will be passed to catch block and will display the error End try | |
Re: Use a list box instead of list view before the code clear the list box every time else the value will be repeated... use a distinct function in ur select query if the query is returning duplicate values after the executer use a `debug.Print("Query: "+ acscmd.CommandText) ` it will help … | |
Re: use this `TextBoxDataKode.Text = DGS4.CurrentRow.Cell(0).Value` instead of `TextBoxDataKode.Text = DGS4.Item(1, GridView.SelectedRows(0).Index).Value` | |
Re: I have done this thing...chec below if it helps u 'Path1 is a string variable declared globally Dim di As DirectoryInfo = New DirectoryInfo(Application.StartupPath & "\Images\" + patientname + Date.Today.ToString("yyyy.MM.dd")) --- checked if a directory exists If Not di.Exists Then 'if no create the directory di.Create() Dim fileLoc As String … | |
Re: darthswift00 - I guess for select query u should write `ExecuteQuery()` and not `ExecuteNonQuery()` | |
Re: Y use a variable??? u could have also done without a variable...just suggested... TextBox9.Text = login.LevelofAccessTextBox.Text | |
Re: if ur format is MMM-yyyy then u will get the output correctly....but the date will be wrong...it will be the first of the month... | |
Re: this code shud be written SELECT td.num,SUM(td.cost) AS Total,tp.prize FROM tblData td, tblPrize tp WHERE td.num = tp.num GROUP BY td.num, tp.Prize | |
Re: In ur insert query u can use the following to get the date.... Date.Today.Year.ToString and then concatenate the remaining value to the string | |
Hello Friends, I need idea for my below process... I have one medical prescription form in my table....which will generate bill...and a receipt number will be generated in crystal reports.... If suppose a bill is generated for a particular transaction and after suppose few days i need a duplicate bill....how … | |
Hello Friends, I need one help I have a datetimepicker control, a combobox with day i.e. Sunday, Monday and so on.... The datetimepicker min date will be todays date and max date will be more 7 days...i.e. a week... so the days dont get repeated..means sunday will come only one … | |
Hello Friends, I want a small help... I have created a text box....a button and a date time picker control I have showed the calander control on click of the button event....when a value is selected in the datetimepicker the value should be showed in the text box... I have … |
The End.