Executing sql stored procedure and storing result set in dataset
-
Hi all, I need help to execute sql stored procedure using linq to sql and result set should be stored in dataset. Thanks in advance. Praveen Kumar Palla
Why would it need to be in a dataset? The idea of linq to sql is to give you strongly typed objects from SQL. Putting this back into a DataSet will defeat the purpose of using Linq to SQL in the first place.. no? perhaps you want to use Ling to Dataset instead? http://msdn.microsoft.com/en-us/vbasic/bb688086.aspx[^]
modified on Wednesday, June 24, 2009 7:05 AM
-
Why would it need to be in a dataset? The idea of linq to sql is to give you strongly typed objects from SQL. Putting this back into a DataSet will defeat the purpose of using Linq to SQL in the first place.. no? perhaps you want to use Ling to Dataset instead? http://msdn.microsoft.com/en-us/vbasic/bb688086.aspx[^]
modified on Wednesday, June 24, 2009 7:05 AM
Thanks for the reply I need the result set should be in dataset since in my requirement there should be parent-child relation in grid for that i need to create datarelation between the different datatables in dataset and then assign the datasource to parent and child using datarelation. Please help me on this...
-
Thanks for the reply I need the result set should be in dataset since in my requirement there should be parent-child relation in grid for that i need to create datarelation between the different datatables in dataset and then assign the datasource to parent and child using datarelation. Please help me on this...
-
Hi all, I need help to execute sql stored procedure using linq to sql and result set should be stored in dataset. Thanks in advance. Praveen Kumar Palla
Good question but no result,iam also in same line
-
Hi all, I need help to execute sql stored procedure using linq to sql and result set should be stored in dataset. Thanks in advance. Praveen Kumar Palla
Iam also same problem please give me a solution
-
Using the "Linq to SQL classes" (
dbml
) designer in visual studio, you can set an association between the tables, thus setting a parent-child relationship...Hi, My stored procedure returns result set not from single table, there is some business logic in the stored procedure based on that getting the values required and inserting into temporary table created in the stored procedure finally stored procedure will return the result set from the temporary table. In the same way there are similar stored procedures and each will return the result set and there will be a relation in the result sets. Normarally we are executing the stored procedure and getting the result set(s) into the same dataset with different datatables in that and creating datarelations based on the on common value and then binding the dataset to xceed grid (third party control) as partent child but inorder to accomplish this using linq i need to execute the stored procedure and result set should be stored in dataset. Please help me on this...Thanks in advance.
-
Hi, My stored procedure returns result set not from single table, there is some business logic in the stored procedure based on that getting the values required and inserting into temporary table created in the stored procedure finally stored procedure will return the result set from the temporary table. In the same way there are similar stored procedures and each will return the result set and there will be a relation in the result sets. Normarally we are executing the stored procedure and getting the result set(s) into the same dataset with different datatables in that and creating datarelations based on the on common value and then binding the dataset to xceed grid (third party control) as partent child but inorder to accomplish this using linq i need to execute the stored procedure and result set should be stored in dataset. Please help me on this...Thanks in advance.
Hi, Are you saying that the stored procedure could return different column names each time it's run? If so, I don't think it'd be possible to achieve what you want to do... If not, then my previous reply should still work, as the stored proceure will be returning the same columns each time it runs, regardless of how it builds up it's data internally. Cheers, Sk93
-
Hi, Are you saying that the stored procedure could return different column names each time it's run? If so, I don't think it'd be possible to achieve what you want to do... If not, then my previous reply should still work, as the stored proceure will be returning the same columns each time it runs, regardless of how it builds up it's data internally. Cheers, Sk93
Hi, My stored procedure will return same columns every time. As of now i am using the following code to bind the data to grid as partent child. Can you suggest me what to do inorder to get the same results without dataset using linq. frmGTGReport_XdgvGTGReport.DataRows.Clear() frmGTGReport_XdgvGTGReport.DetailGridTemplates.Clear() frmGTGReport_XdgvGTGReport.Columns.Clear() frmGTGReport_XdgvGTGReport.GroupTemplates.Clear() frmGTGReport_XdgvGTGReport.BeginInit() frmGTGReport_XdgvGTGReport.SingleClickEdit = True frmGTGReport_XdgvGTGReport.FixedColumnSplitter.Visible = False frmGTGReport_XdgvGTGReport.DataRowTemplate.CanBeSelected = False frmGTGReport_XdgvGTGReport.DataRowTemplate.FitHeightToEditors = True frmGTGReport_XdgvGTGReport.SynchronizeDetailGrids = True ''binding selected protocol and institution to UI as parent frmGTGReport_XdgvGTGReport.SetDataBinding(dsTemp, "Protocol") ''creating data relation for selected protocol and IRB Dim data_relation_ProtocolIRB As New DataRelation("Protocol_IRB", dsTemp.Tables("Protocol").Columns("Protocol"), dsTemp.Tables("IRBRegNo").Columns("Protocol")) dsTemp.Relations.Add(data_relation_ProtocolIRB) Dim detailGridTemplate_ProtocolIRB As New DetailGrid() detailGridTemplate_ProtocolIRB.SetDataBinding(dsTemp, "Protocol.Protocol_IRB") detailGridTemplate_ProtocolIRB.HeaderRows.Add(New ColumnManagerRow()) frmGTGReport_XdgvGTGReport.DetailGridTemplates.Add(detailGridTemplate_ProtocolIRB) Dim data_relation_IRBVersion As New DataRelation("IRB_Version", dsTemp.Tables("IRBRegNo").Columns("IRB Registration Number"), dsTemp.Tables("Versions").Columns("IRB Registration Number")) dsTemp.Relations.Add(data_relation_IRBVersion) Dim detailGridTemplate_IRBVersion As New DetailGrid() detailGridTemplate_IRBVersion.SetDataBinding(dsTemp, "Protocol.Protocol_IRB.IRB_Version") detailGridTemplate_IRBVersion.HeaderRows.Add(New ColumnManagerRow()) detailGridTemplate_IRBVersion.Collapsed = False detailGridTemplate_ProtocolIRB.DetailGridTemplates.Add(detailGridTemplate_IRBVersion) frmGTGReport_XdgvGTGReport.EndInit()
-
Hi, My stored procedure will return same columns every time. As of now i am using the following code to bind the data to grid as partent child. Can you suggest me what to do inorder to get the same results without dataset using linq. frmGTGReport_XdgvGTGReport.DataRows.Clear() frmGTGReport_XdgvGTGReport.DetailGridTemplates.Clear() frmGTGReport_XdgvGTGReport.Columns.Clear() frmGTGReport_XdgvGTGReport.GroupTemplates.Clear() frmGTGReport_XdgvGTGReport.BeginInit() frmGTGReport_XdgvGTGReport.SingleClickEdit = True frmGTGReport_XdgvGTGReport.FixedColumnSplitter.Visible = False frmGTGReport_XdgvGTGReport.DataRowTemplate.CanBeSelected = False frmGTGReport_XdgvGTGReport.DataRowTemplate.FitHeightToEditors = True frmGTGReport_XdgvGTGReport.SynchronizeDetailGrids = True ''binding selected protocol and institution to UI as parent frmGTGReport_XdgvGTGReport.SetDataBinding(dsTemp, "Protocol") ''creating data relation for selected protocol and IRB Dim data_relation_ProtocolIRB As New DataRelation("Protocol_IRB", dsTemp.Tables("Protocol").Columns("Protocol"), dsTemp.Tables("IRBRegNo").Columns("Protocol")) dsTemp.Relations.Add(data_relation_ProtocolIRB) Dim detailGridTemplate_ProtocolIRB As New DetailGrid() detailGridTemplate_ProtocolIRB.SetDataBinding(dsTemp, "Protocol.Protocol_IRB") detailGridTemplate_ProtocolIRB.HeaderRows.Add(New ColumnManagerRow()) frmGTGReport_XdgvGTGReport.DetailGridTemplates.Add(detailGridTemplate_ProtocolIRB) Dim data_relation_IRBVersion As New DataRelation("IRB_Version", dsTemp.Tables("IRBRegNo").Columns("IRB Registration Number"), dsTemp.Tables("Versions").Columns("IRB Registration Number")) dsTemp.Relations.Add(data_relation_IRBVersion) Dim detailGridTemplate_IRBVersion As New DetailGrid() detailGridTemplate_IRBVersion.SetDataBinding(dsTemp, "Protocol.Protocol_IRB.IRB_Version") detailGridTemplate_IRBVersion.HeaderRows.Add(New ColumnManagerRow()) detailGridTemplate_IRBVersion.Collapsed = False detailGridTemplate_ProtocolIRB.DetailGridTemplates.Add(detailGridTemplate_IRBVersion) frmGTGReport_XdgvGTGReport.EndInit()
-
Yes. DBML will do this for you....... http://msdn.microsoft.com/en-us/library/bb425822.aspx#linqtosql_topic5[^]
Thanks i will go through and try to solve my problem...