M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i think you have to code at grid double or single click event . it will work fine :)

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello!
i think you want to develop POS (point of sale) software , please google it by typing POS , there may be some demo out there , and also some online guide , that will help you allot

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello!
please check this code , it is in vb.net but may be this will give you any idea :)

Sub Purchase_VenderWise()
        With Frm_ListOfPurchaseHistory

            .rpt_PurchaseHistory1.DataSourceConnections(0).SetConnection(myCrServerName, myCrDatabaseName, myCRUserName, myCRUserPassword)
           .CrystalReportViewer1.SelectionFormula = "{PurchaseHead.VenderID}=" & Val(Me.txtinput.Text)
           
            .CrystalReportViewer1.SelectionFormula = "{PurchaseHead.PurchaseDate} in DateTime(" & Me.dtpfrom.Value.Year & "," & Me.dtpfrom.Value.Month & "," & Me.dtpfrom.Value.Day & ") to DateTime(" & Me.dtpto.Value.Year & "," & Me.dtpto.Value.Month & "," & Me.dtpto.Value.Day & ")" & " and {PurchaseHead.VenderID}=" & Val(Me.txtinput.Text)

            .Show()

        End With

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello skran !
are you using sql query to get filtered records from database and show them in datagrid.???

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i am working on an application and i want to connect it with mssql database , i dont know about the version of installed mssql server at the pc , how can i get the version of installed mssql server so that i can connect my application with that .(is it possible to check the version of installed mssql server with out connecting it with my application.)
please help me in this
Best Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i am working on an application and i want to connect it with mssql database , i dont know about the version of installed mssql server at the pc , how can i get the version of installed mssql server so that i can connect my application with that .(is it possible to check the version of installed mssql server with out connecting it with my application.)
please help me in this
Best Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

both are good , i think it depend on your requirement .

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !

rpt.RecordSelectionFormula = "{cashtbl.stdid}='" +Convert.ToInt32(textBox2.Text) + "'";

in above line you are converting textbox value in to integer and after that you are using '' and dealing like a string .use this

rpt.RecordSelectionFormula = "{cashtbl.stdid}= +Convert.ToInt32(textBox2.Text);

Hope this will solve your prob,if yes please mark your thread solved :)

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello honeybee2090!

here is simple code to perform same action ,

'use this code at you button click event 
   Dim i As Integer
        Dim x As Integer
        Dim no As Integer
        Dim rec As New ArrayList
        For i = 0 To ListBox1.Items.Count - 1

            no = 0
            A = ListBox1.Items(i).ToString
            For x = 0 To ListBox1.Items.Count - 1
                B = ListBox1.Items(x).ToString
                If A = B Then
                    no = no + 1
                    If no >= 2 Then
                        MsgBox("duplicate record=" & B)
                        Exit For
                    End If
                End If
            Next



            If no < 2 Then
                rec.Add((ListBox1.Items(i)))
            End If
        Next
        Dim ab As Integer
        For ab = 0 To rec.Count - 1
            ListBox1.Items.Remove(rec.Item(ab))
        Next

hope this will solve your prob :) if yes then mark your thread solved and vote me up :)

Best regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

try to use mouse hover event of the grid and place your binding code in it ,

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello!
you can do like this harrispc

'put this code on the load event of the form
'before coding set selection property of grid to full row select
DataGridView1.Focus()
DataGridView1.Rows.GetFirstRow(DataGridViewElementStates.Visible)
'and shann1718 u can do like this         
DataGridView1.Rows.GetLastRow(DataGridViewElementStates.Visible)

hope this will helps you

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello Awais
try this code

Dim cn As ADODB.Connection 'ADODB Connection Object
        Dim rs As New ADODB.Recordset 'Recordset Object
        Dim sqlStr As String ' String variable to store sql command
        
        Set cn = New ADODB.Connection
        
        cn.ConnectionString = "Provider = MSDASQL;" & _
            "Data Source=LocalServer;" & _
            "Initial Catalog=sample;" & _
            "Login ID=SERVANT;" & _
            "Driver=SQL Server;"

        cn.Open
 'your code        
        cn.Close
M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
you can do like this

'enable timer by using this code
timer1.enable= true
'now give interval , 1000 = 1 sec you want to perform action after 60 sec so
timer1.interval=60000
'now code this on the timer tick event 
My.Computer.Audio.Play("ur sound file path")

hope this will solve you prob
Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello!
may be this will help you
Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
use this code to insert your data in your database table

dim myCon as new sqlconnection("string_connection")
dim cmd as new sqlcommand
mycon.open() 
cmd.connection = myCon
cmd.commandtext= "insert into CheckIn(field1,filed2,field3,field4...." values (@field1,@field2,@field3,@field4.....)
cmd.parameter.add ("@field1".sqldatatype.varchar(50)).value = txtbox1.text
cmd.parameter.add ("@field2".sqldatatype.varchar(50)).value = txtbox2.text
cmd.parameter.add ("@field3".sqldatatype.varchar(50)).value = txtbox3.text
cmd.parameter.add ("@field4".sqldatatype.varchar(50)).value = txtbox4.text
.
.
.
cmd.executenonquery()
mycon.close()

hope this will help you to solve your prob , there may be some spelling mistake as i type all code here , so there is no way to check them , please check it out and if you have some prob with this code then do inform me :)

Best Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i am very new in webdevelopment , i want to use ExtJs , please help me , i download the extjs-4.0.1 .now please tell me how to import it in my project , i mean is i copy this extjs-4.0.1 to my project or is there is another way to import it , 2nd question is where to place JS code in head section or in body section , please help me and if you have enough time then show me some sample code ,so that i can start my work on it .

Best Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

trye this query

"update tablename set status=@status where DateOfReturn='" & datetimepicker.value.date & "' and AND TimeOfReturn >= '" & datetimepicker1.value.time & "'"

hope this will solve your problem .

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

sorry but i cant get your point , can you please tell me that you want to create buttons and stopwatches dynamically , but how to get the number of buttons and stopwatches you have to create ? . sorry for my bad english , but rephrase your question so that i can help you

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

you can not delete single column value , you have to delete full record , if you want to delete value of single column then try to use update , just update the value with null .

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i dont have any experience of access , i am writing here code for mssql , hope this will gives you an idea

dim mycon as new sqlconnection("connectionstring")
dim da as sqldataadapter("select * from SaleInvoice where InvoiceID="& val(txtInvoiceID.text),mycon)
dim dt as datatable
da.fill(dt)
datagridview.datasource=dt

this record show all the records of invoice id given in textbox in datagrid , hope this will helps you

Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

mani-hellboy thanks for your replay but this link is not what i am looking for ,

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

i think you have to use query which get only required columns ,

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
for example we have two variables

int first ;
string second ;
string Final;
first = 23;
second = "rollNo";

//you can concatenate them like this 
Final = second + "=" + first;

hope this will helps you

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
I want to use JSON in my asp.net project using c# .how can i do that , i am very new in JS and JSON , please help me so that i can start work .i googled about it , and read some posts on different forums and sites . now i am understanding the JSON .but when i dont know how to use JSON in my project , i use

using System.Web.Script.Services;
using System.Web.Script.Serialization;

but still confused , please can any one guide me from 1st step so that i can start working :(

Thanks in advance


Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i tried to use your given script but its not working.you should take a look in your table name hrOgranizationSetup , for example , if there is two records having OsID 100 and 101 , and you are trying to insert records in table name hrBranchSetup_Audit with Osid 102 then foreign key conflict error come .
Hope this time you can better understand .and sorry for my bad english

Regards
M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

do you worked on it? , do some efforts then others will help you ,

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
you can perform your required function like this

dim myCon as new sqlconnection("connection string")
dim cmd as new sqlcommand
dim i as integer
myCon.open()
for i = 0 to datagrid1.rows.count -1 
   cmd.commandtext = "delete from table1 where RecID=@RecID"
   cmd.connection = myCon
   cmd.parameter.addwithvalue("@RecID",datagrid1.item(0,i).value)
   cmd.executenonquery()
next
myCon.close

i write this code here in posting thread textbox so may be there is some spelling mistake , but i hope even if this will not solve your prob but this will give you a idea to solve your prob.(sorry for bad english)

Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello PF2G !
use this code to fill combobox

dim myCon as new sqlconnection("ConnectionString")
myCon.open()
dim da as new sqldatadapter("yourquery_select username from users",myCOn)
dim dt as datatable
da.fill(dt)
combobox.datasource = dt
combobox.displaymember = "username" ' your column name ,which you want to show

hope this will helps you
Regards
M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

this error occurs only when we try to entered the foreign key which is not in its parent table ,sorry for my bad english. first try to look at your relations between hrBranchSetup and hrBranchSetup_Audit , hrBranchSetup has a PK OsID and hrBranchSetup_Audit has FK OsID .you should have PK in hrBranchSetup before you insert record in hrBranchSetup_Audit .
Hope this will helps you

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

i am using asp.net with c# , can you little bit explain about ajax with JSON .

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
my boss assign me a task to connect mssql server 2008 and show records in table using JS and JSON , i m very new in asp.net , can any one me help me where to start my work and how i can complete this , can any one tell me about site , bolgs or other helping tutorials so that i can make it possible in short time

Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i have experience in VB.net,C# and MSSQL2000,2005,2008r2 .but today my boss assign me a task to connect mssql server 2008 by using JS or JSON ,both are unknown for me ,:( i dont have any knowledge about JSON and JS , can any one help me how to connect mssql server 2008 using JS or JSON and what is the basic difference between JS and JSON :(

Please I need your help

Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello EveryOne!
i am very new in JS and JSON , or you can say this is my first day to learn something about JS and JSON, i have few questions
1- what is difference between JS and JSON.
2-My Task is to connect MSSQL server 2008 and show records in table from where i can start working
3- Any site,Blog , Tutorial video or online book which you recommend for me .
4-I have knowledge about HTML and little bit php ,so can it will easy for me to complete my task

please help me ,every ans will help me to complete my task

Best Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

it is not possible ,if you use order by desc then it will sort all records descending order . but you want just to show single column like this , this will will effect all the related records

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

try form.focus() , may be this will work for you :)

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
try to use query to get filtered records , and then populate your grid

select customer,Model,Foam,Grade,item,Thick,Width,Length,sum(Qty),25 as ItemPerPackage
from YourTable
group by customer,Model,Foam,Grade,item,Thick,Width,Length

Hope this will help you

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

plese first tell about your tables which are used in this query

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
check www.iconfinder.com , hope this will solve your prob

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster
M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
if Reverend Jim is right then why not you try to use global variable to get your values , as Reverend Jim said that 'may be by the time you try to get values the form has entered a state where that data is not available'

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
why not you try a stored procedure to delete records from multiple table , by using stored procedure you have to do very little coding .

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
use this code to open another form , on the click event

formEventRegistration.show ()

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
you should visit telerik official web site http://www.telerik.com/ this will help you alot

Regards

M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

then just call the sub on the load event of your form

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

this is not fair , i try to solve the prob and some body give me negative vote :( ,

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
you can do , like this

'first make this sub
   sub MyInsert(ByVal SaleDate As Date) As Integer
        Try
            MyFields = "(SalesDate)"
            MyValues = "(@SalesDate)"
            MyConn.Open()
            Dim Mycmd As New SqlCommand
            Mycmd.Connection = MyConn
            Mycmd.CommandText = "insert into " & MyTableName & " " & MyFields & " Values " & MyValues
            Mycmd.Parameters.Add("SalesDate", SqlDbType.DateTime).Value = SaleDate
            Mycmd.ExecuteNonQuery()
            MyConn.Close()
            'Return 1
        Catch ex As Exception
            MsgBox(Err.Description)
        End Try
end sub

'now use this loop to save your dates
dim InsertDate as datetime
insertDate = datetimepickerFromDate.value.date
while InsertDate<= datetimepickerEndDate
MyInsert(insertdate)
insertdate.AddDays(1)
end while

Hope this will helps you , if your prob is solved with it , please mark this thread solved and vote me up :)
Regards
M.Waqas Aslam

M.Waqas Aslam 67 Posting Pro in Training Featured Poster
M.Waqas Aslam 67 Posting Pro in Training Featured Poster

oh sorry :P here is complete code

sub MyInsert(byval salesid as integer , byval salesdate as datetime)
   Try
            MyFields = "(SalesID,SalesDate)"
            MyValues = "(@SalesID,@SalesDate)"
            dim MyConn as new sqlconnection("connectionstring")
            MyConn.Open()
            Dim Mycmd As New SqlCommand
            Mycmd.Connection = MyConn
            Mycmd.CommandText = "insert into  table1  Values " & MyValues
            Mycmd.Parameters.Add("SalesID", SqlDbType.BigInt).Value = saleid
            Mycmd.Parameters.Add("SalesDate", SqlDbType.DateTime).Value = SaleDate
'and you can directly provide textboxes values as a parameters like this
  Mycmd.Parameters.Add("SalesID", SqlDbType.BigInt).Value = val(txtsalesid.text)
            Mycmd.Parameters.Add("SalesDate", SqlDbType.DateTime).Value = datetimepicker.values.date
          
            Mycmd.ExecuteNonQuery()
            MyConn.Close()
            'Return 1
        Catch ex As Exception
            MsgBox(Err.Description)
        End Try
end sub
'now where you call this sub you have to give two parameters like this
myinsert(val(txtsalesid.text),datetimepicker.value.date)

hope this time this will helps you :) if you like my ans please mark this thread solved :)

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

then i think its not possible in a simple way , because there is no property of form which support this , but i have an idea :P why not you simply put a media player component and then put button on it and set your media player component send to back and set your control bring to front. may be it will work :P but it is just an idea

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

y not you are using concatenation for this , i cant understand your question , but i assume that if you press add button then the line will add in your giving format ,

'code this on the click event of your button
datagrid1.rows.add(txtserialno.text,txtproductid.text,"TEST0000"& textorderid.text)

if please you can rephrase your question then i can help you in much better way

Regards