sql server - Why is my table-valued parameter empty when reaching the database? -


I am trying to test the new table-valuable parameter functionality of SDC 2008 which is the ADO. , But I am running into a problem where there is no row in the parameter when it goes to the stored procedure UDT looks like this:

 Type  [DBO]. [Personnote] AS Table ([first name] [Warar] (50) Faucet, [LastLime] [VARAR] (50) Faucet, [Birthday] [Date] Faucet  

stored proc Looks like this:

  the process of making [DBO]. If started as [AddPeople] (@peopleToAdd dbo PersonType READONLY) (Add people from SELECT COUNT (*) FROM) & gt; 0 Start Select 'Rows are' End Select 'Rows are not ending' END  

And finally, the .NET code is this (brace yourself, this is very much): < Public class program {static zero main (string [] args {person compile people = new person compilation (new person {first name = "john", last name = "do",} Birthday = new date time (1975, 12, 1)}, new person {first name = "Randall", lastname = "Stevens", born N = new Date Time (1 9, 35, 7, 10)}}; (SqlConnection conn = new SqlConnection ("Data Source = Localhost \\ scllexpress; Initial Catalog = TVPExample; Integrated Security = SSPI;")) {conn.Open (); SqlCommand CMD = New SqlCommand ("AddPeople", conn); SqlParameter parameter = cmd.Parameters.AddWithValue ("LogoutAud", People); Parameter.SqlDbType = SqlDbType.structured; Parameter. Type name = "dbo.PersonType"; String result = cmd.ExecuteScalar (). ToString (); Console.WriteLine (results); }}} Public class person {public string first name {receipt; Set; } Public String LastName {get; Set; } Public DateTime Birthday {Received; Set; }} Public Class PersonCollection: List & lt; People & gt ;, IEnumerable & lt; SqlDataRecord & gt; {#region Implementation of IEnumerable & lt; SqlDataRecord & gt; IEnumerator & LT; SqlDataRecord & gt; IEnumerable & lt; SqlDataRecord & gt; GETEnumerator () {SqlDataRecord RE = New SqlDataRecord (New SqlMetaData ("FirstName", SqlDbType.VarChar, 50), New SqlMetaData ("LastName", SqlDbType.VarChar, 50), New SqlMetaData ("Birthday" SqlDbType.Date)); Foreign (person in this) {rec.SetString (0, person.FirstName); Rec.SetString (1, person.LastName); Rick .Setetime (2, person birth); Yield returns Rick; }} I used the blog post as an example, I always get the "do not keep the lines" as a result, but seeing the address of the Visual Studio debugger It turns out that in the collection I am passing, there are two values ​​which I have kept. any idea? What am I missing?

Add it:

  cmd.CommandType = command type Stored procedure;  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -