you are talking about cmbid.text which is used in this code ,
http://www.daniweb.com/software-development/vbnet/code/217047
cmb normally used for combo box , try to search naming conventions in vb.net , you will find some good info.
Regards
you are talking about cmbid.text which is used in this code ,
http://www.daniweb.com/software-development/vbnet/code/217047
cmb normally used for combo box , try to search naming conventions in vb.net , you will find some good info.
Regards
i think datareader is slower then dataadapter , but yes we can use datareader also for this purpose.but speed is something which is imp for any application.
hello !
you can use substring() to perform this task , try this
txtTest.text = txtFirstName.text.Substring(0, 3).ToString
if you found this ans useful please mark this thread solved and vote me :P
Regards
hello !
try this may be this will solve your prob
dim con as new sqlconnection("connectionstring")
con.open()
dim da as new sqldataadapter("select firstname,lastname,address from table where firstname='" +txtfirstname.text+"' and lastname='"+txtlastname.text +"' and address='"+ txtaddress.text+"'",con)
dim dt as new datatable
da.fill(dt)
if dt.rows.count = 0 then
'means record is not in db , you can save
else
'record is already in db , so dont save
end if
this is not the ideal solution as i think this thing make your program slow ,but it will solve your prob .
if your prob is solved then please mark this thread solved .
Regards
you want that some one give you the complete code for your prob ?
no , val does not cause any issue in vb.net as i am continuously using it in about 2.5 years , :)
Regards
hello !
try this
Dim price As Decimal = val(txtprice.Text)
Dim quantity As Integer = val(txtquantity.Text)
Dim totalprice As Decimal = val(txttotal.Text)
totalprice = val(val(quantity) * val(price))
this will work fine ,
Regards
yes you can do this , make a user module and when a user login in prog , he have to login with his id , then you can check which functions he can perform .
Regards
thanks guys for your valuable time and comments , :)
God bless you all
Regards
then please mark this thread solved ,
hello !
try this ,
'here is a function
Dim objRandom As New System.Random( _
CType(System.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer))
Public Function GetRandomNumber( _
Optional ByVal Low As Integer = 1, _
Optional ByVal High As Integer = 100) As Integer
' Returns a random number,
' between the optional Low and High parameters
Return objRandom.Next(Low, High + 1)
End Function
'now place this code at the event where you want to assign random numbers.
Dim intDiceRoll As Integer
intDiceRoll = GetRandomNumber(1, 6)
txt1.text=intDiceRoll.ToString
txt2.text=intDiceRoll.ToString
txt3.text=intDiceRoll.ToString
txt4.text=intDiceRoll.ToString
.
.
.
.
hope this code helps you , if your prob is solved then please mark this thread solved .
Best Regards
thanks both of you , for taking interest .
Regards
hello !
basically i am working on .net , but now i want to learn java , is there any software like visual studio for .net .if yes then please can any one tell me or provide me any helpful link.
Best Regards
M.Waqas Aslam
please read this thread carefully , i hope you will get your solution,http://www.vbforums.com/showthread.php?t=453632
if you find it , then please mark this thread solved and vote me :P
Regards
there are so many softwares which are used to make installation packages , but vs also has its own setup wizard , here is a link hope this will helps you and gives you an idea.http://www.techrepublic.com/blog/programming-and-development/adding-a-setup-wizard-to-vbnet-applications/516
Best Regards
yes i think you have to put your code at the got focus of that textbox , because without getting focus no change can be performed.
Regards
please check these links if you want to use max or top clauses.
for top
http://msdn.microsoft.com/en-us/library/ms189463.aspx
for max
http://msdn.microsoft.com/en-us/library/aa933240(v=sql.80).aspx
If you need any more help please post here .
Regards
ok try this
'place this code at the click event of your grid , but please make sure that the selection property is set to the full row select.
txtid.text = datagridview.item("columnname/Index",datagridview.currentrow.index).value.tostring() 'if you give the column name then use "" if you want to give index then dont use them.
If this code solve your prob . please mark your thread solved and vote me up :)
Regards
well if you are using auto increment in your id then try max function to get the max id , or if your auto generated id is not a number then there are two options 1- use top clause and the 2nd option is to make a new field name insertTime, and save the inserted time in it , then you will be able to access any id according to your required time period .
Regards
ok well use this , may be this will solve your prob
dim i as integer
dim a as string
for i = 0 to datagridview1.rows.count-1
a = datagridview1.item(2,i).value.tostring()
if a = Now.Date.ToString() then
'now here put your code you want to execute
endif
next
Regards
well, dilse4sk you dont mention about which booking you want to do with your software , but here is a link , hope this will give you an idea , and please always post this type of thread in gernal discussion forum .Mark this thread solved because there is no end of it .
http://userful.com/products/userful-pre-book
Best Regards
if your prob is solved then please mark this thread solved :)
Regards
when you create a report then you used a query or tables in it , in above code you are just calling that report . well please post some snaps of your report here ,
Regards
hello !
please check the following link , hope this will will solve your prob :)
http://www.sdn.sap.com/irj/boc/support?rid=/webcontent/uuid/d01fdad8-44e5-2d10-61ad-9d2d4158f3a8
Regards
i think in your booking application add sms and email modules to give alerts to the customers .
then please do some effort , after that if you have any prob then we are here to help you :) , with out effort there is no learning .
is it your class assignment or homework ?
well i suggest you to use head and detail tables for this to maintain your records, for example headtable has fields , RecHeadID,LeaveType,MaxDays and detail table fields RecDetailID,EmpID,RecHeadID,from,to with these two tables you can manage all your leave details of your employees , but here is a query for your current table ,
select employeeid,leavetype,leavenumber,leaveuse , (leavenumber-leaveuse) as leaveleft
from
(
select employeeid,leaveType,LeaveNumber,
(
select sum(leaveuse)
from table1
) as LeaveUse
from table1
) m
i not tested it. if you caught any error , please do inform me,
Regards
where is the limit of days ? i mean in which field you are defining the limit as you mentioned above 10 is the limit?
please provide the fields of your tables , which are used in this query , so i can able to provide you solution.
Regards
please can you show your query , so we can help you .
and please check these links
http://www.crystalkeen.com/articles/crystalreports/groupexpert.htmhttp://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=4728
Regards
please first provide your query which you are using in your report . then we can help you in a better way. with out knowing the reason nobody can provide a solution.
Regards
try this may be this will helps you
If reader.Read = True Then
dim a as integer
a = val(reader.read).tostring()
if a <> null then
Debug.Print("True")
endif
Else
Debug.Print("False")
End If
this is just an idea , so please check it by your self .
Regards
this is my query i used it in my project , this will give you an idea .
select ProductName ,Packing , BatchNbr ,ExpiryDate ,ExpireInDays
from (
select ph.productname,ph.Packing ,b.BatchNbr ,b.ExpiryDate ,d.distributorid,
case when b.ExpiryDate > GETDATE() then DATEDIFF(dd, GETDATE(),b.ExpiryDate )
else DATEDIFF(dd, GETDATE(),b.ExpiryDate ) end as ExpireInDays
from HOProducts ph
inner join DistProducts dp on ph.HOProductId = dp.HOProductId
inner join InvoiceTransactionBody itb on itb.ProductId = dp.ProductId
inner join Distributors d on dp.DistributorId = d.DistributorId
inner join Batches b on itb.BatchNo = b.BatchNbr
) as n Where 1=1
Regards
you can use
DATEDIFF(dd, FirstDate,2ndDate )
this will return difference of days .firstdate and 2nd date are two dates .hope this will solve your prob.:)
If yes then please mark your thread solved and vote me up :)
Regards
you want to perform this action in your query or in your application?
hello !
when ever there is a situation like this then always use two or more then two condition for updating and deleting records. for example . you have many fields in grid , one of them is ID and 2nd one is Name , just do like this
sqlDelete = "DELETE * FROM table1 WHERE ID ='" & form1.dgv1.CurrentRow.Cells(0).Value.ToString & "' and name='"& form1.dgv1.CurrentRow.Cells(0).Value.ToString & "'"
If please provide all columns name then i can able to provide you a good solution. if i helped you please mark this thread solved and vote me up .
Regards
can you please explain what you really want to do ?
and please try this query , may be this will solve your prob .
"select sum(tmt.total) as Total from Appointment appt inner join TreatmentMaster tmt on [tmt].[treatid]=[appt].[treatmentid] where appt.patientid='" + txtPatIDBill.Text + "' and [appt.ApptDate] between '" + dtpFromBill.Value.Date.tostring() + "' and '" + dtpToBill.Value.Date.tostring() + "'"
hello !
do you try dtpFromBill.Value.Date.tostring() instead of this dtpFromBill.Value.Date .
Regards
hello!
try this code
dim i as integer
for i = 0 to datagridview1.rows.count-1
if datagridview1.item(2,i).value.tostring = Now.Date.ToString() then
'now here put your code you want to execute
endif
next
Hope this will helps you if yes then please mark your thread solved and vote me up :)
Regards
hello !
please use this code this will solve your prob :)
Dim str As String
Dim strArr() As String
Dim count As Integer
str = txtUsername.Text ' txtbox having txt you wana split.
strArr = str.Split("_")
For count = 0 To strArr.Length - 1
If txt1.Text = "" Then
txt1.Text = strArr(count).ToString
Else
If txt2.Text = "" Then
txt2.Text = strArr(count).ToString
Else
If txt3.Text = "" Then
txt3.Text = strArr(count).ToString
End If
End If
End If
Next
if your prob is solved then pleas mark this thread solved and also dont forget to add reputation .
Regards
you wc :)
hello !
Yes,there is a way.
Set KeyPreview property of your Form to True.
And use this code for your Form_KeyDown event:
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Return Then
SendKeys.Send("{TAB}")
End If
End Sub
hope this helps you.
Regards
yes this error is only occurs when you want to edit foreign key , for example , if there is two table having fields . Stuid , name and table 2 has fields id , stuid ,in this situation if you want to edit value of Stuid in table then it is necessary that table1 has same value .in it . hope this will help you.
Regards
use loop to insert your data in array , and then print then in textbox and manually use vbCrLf after printing each value , your data will be in your required format .
Regards
hello!
please check this link , may be this will solve your prob :)
http://www.codeproject.com/Articles/11056/Exporting-DataGrid-to-Excel-Word-and-Text-Files
alyngill is right , use above mentioned code , it will solve your prob .
Regards
hello !
you can use this code at the double click event of the listbox whose value you want to show.
Form2.ListBox1.Items.Add(ListBox1.SelectedItem.ToString)
hope this code helps you , if yes then please vote me up :)
Regards