Pretty much exactly as the error states, you need to specify the UdtTypeName for UDT types in SQL Server (geography and geometry are implemented as CLR datatypes just like UDTs). Try this:
SqlConnection con = connection;
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "INSERT INTO Fietsnetwerk (tid, regio, land, afstand, kleur, data) VALUES (@id,'Vlaanderen',1,0,1,@linestring)";
cmd.Parameters.AddWithValue("@id", tracknode.getTrackId());
SqlParameter param = cmd.Parameters.AddWithValue("@linestring", SqlGeometry.STGeomFromText(new System.Data.SqlTypes.SqlChars("LINESTRING (3.788 50.899, 4.743 51.4333)"), 4326));
param.UdtTypeName = "geography";
cmd.Connection = con;
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
If data is a geometry column, then change to param.UdtTypeName = "geometry"; instead
twitter: @alastaira blog:
http://alastaira.wordpress.com/