getitems()is the query which retrieves data i need to filter cod in id column . i dont know y u want see the code for stored procedure since its just a query ...... select id ,A,B,C from Items where Code =@cod :-D
so much of happy ending...
getitems()is the query which retrieves data i need to filter cod in id column . i dont know y u want see the code for stored procedure since its just a query ...... select id ,A,B,C from Items where Code =@cod :-D
so much of happy ending...
items search through storedprocedure the entire code here... Private Sub getItems() c.ConS() c.Cm.Open() For Each row As DataGridViewRow In Me.ItemsDataGridView.Rows Dim cod As Integer cod = row.Cells(0).Value Dim cmd As New SqlCommand("getItems", c.Cm) cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add("@cod", int).Value = cod Dim da As New SqlDataAdapter da.SelectCommand = cmd da.Fill(dat) Me.bind.DataSource = dat Me.ItemsDataGridView.DataSource = bind Next row End Sub
so much of happy ending...
@Eddy Vluggen, see the following ... Column name is id. user enters id number on this column. for retrieving details . For Each row As Windows.Forms.DataGridViewRow In Me.DataGridView1.Rows() Dim id as integer id = row.cell(0).value cmd.Parameters.Add("@id", SqlDbType.int).Value = id next row id | name | address |age 1 | abcd | abcd |abcd 2 | 123 | rr | fr it works only on first row cell. thanks
so much of happy ending...
@Scubapro i need to search data inside datagridview only , when user enter an id number in the id column in every row which should display its details . the code is working fine but not with other rows. i hope u understand this. thanks.
so much of happy ending...
Luc Pattyn well i been trying ur idea but if u show me by peace code will be great !! :) thanks
so much of happy ending...
i used ur code working same as mine, only first row cell it works not for rest ! what i am missing ? thanks for your reply any more ideas ?
so much of happy ending...
the followind code is used for search items from a column cell For Each row As Windows.Forms.DataGridViewRow In Me.DataGridView1.Rows() Dim id as integer id = row.cell(0).value cmd.Parameters.Add("@id", SqlDbType.int).Value = id next row when i enter a value in the Column cell(0) on first row works fine but the problem is when i enter a value in second,third ... row it doesn't work as it should be. can anyone help me to find out what i am missing ? thanks !!!
so much of happy ending...
Thanks to Mycroft Holmes . its really helpful !
so much of happy ending...
Thanks Mohsiul Haque . its really helpful and learned some.
so much of happy ending...
hi dearest brothers/sisters i have created trigger in MSSQL SERVER. CREATE TRIGGER IDx on Table2 after INSERT AS insert into Table2 (RefNo) select RefNo from Table1 i need Table2 Foreign key RefNo to be filled no of times which means eg. table2 may need RefNo to be filled in three rows. currently i get single row others kept NULL values help me plz thanks
so much of happy ending...
hi i already bounded a data to control Textbox therefore it has a value. so i need the same values should be appear in the Datagridview in specified cell[x]. or which is the better way to display a single row from a control to Datagridview. thanks regards zafa
so much of happy ending...
Thanks Arindam D Tewary . it was very helpful. you've understood best. i'll try and let me do your trick. regards zafa
so much of happy ending...
modified on Tuesday, March 23, 2010 12:41 PM
thanks Prakash.
so much of happy ending...
hi. I have search Textbox13 which i enter a codeNumber display it on dataGridView1. every time a new line should display after i search. i need to add new row which also searched and so on. pls help. private void searchx() { string connectionString = ConfigurationManager.ConnectionStrings["smemo.Properties.Settings.smConnectionString"].ConnectionString.ToString(); con = new SqlConnection(connectionString); string Query = "Select CodeNo,Description,Qty,P_Local,Amount from Price_list where CodeNo= " + textBox13.Text; SqlCommand cmd = new SqlCommand(Query, con); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; //DataTable dat = new DataTable(); DataSet ds = new DataSet(); da.Fill(ds,"Price_list"); // BindingSource bs = new BindingSource(); //bs.DataSource = ds.Tables["Price_list"]; dataGridView1.DataSource = ds.Tables["Price_list"]; } thanks best regards zafa
so much of happy ending...
hi bro. you really got my point and you did exactly what i asked for . thanks. But just one thing i needed is that i dont want a textbox. instead i want search data by using datagridview column which is the first column. thanks ...................:)
so much of happy ending...
thanks for your reply. are you sure u did understand my message ? it could be grateful if you could help me in code style, im creating a windows application.
so much of happy ending...
hi i need help in searching records in datagridview and was trying this for days still i couldn't do it... here is the details in a datagridview1 i have the following columns. Code | Description | Price | Qty | Total when user types a code number in the code Column...... description and price is automatically displayed, thanks cheers zafax
so much of happy ending...
Microsoft SQL 2005 --------------------- I created a table name items. which has to be updated with multiple rows at once, only the ID is Unique. (more details) SO when i updated a record there would be six rows with the same items but with different ID. GIVEN BELOW IS A SAMPLE (6 times) --------------------------------- ID | Name | Model| Price --------------------------------- 0001 MotorCar Mazda 62000.00 0002 MotorCar Mazda 62000.00 0003 MotorCar Mazda 62000.00 0004 MotorCar Mazda 62000.00 0005 MotorCar Mazda 62000.00 0006 MotorCar Mazda 62000.00 I guess a range(eg.1 to 15) is required to validate the number of time You may required to update a record. Any suggestion on this would be great indeed. thanks.
so much of happy ending...
hi guys ....im just intresting in serial port programming one simple one i want try now just connecting one gang way switch to PC via serial port. method: when switch was pressed, application should display "switch has been pressed" any ideas ?
so much of happy ending...
YOUR Question seems complicated. you want create functions in ur application which alerts you prayer time on scheduled times? formula? u maybe asking for codes to do so. you know one day i requested a code like as you seems, i got reply saying here codeproject is not for doing work for you. so but there are some good ppl will help you i hope all are not same.
so much of happy ending...