client-side maximum string length enforcement

  • Thread starter Thread starter apandapion
  • Start date Start date
A

apandapion

When I was working with ASP/ADO, I would get the maximum string length
by querying the system tables inside the mssql database. It wasn't the
wisest thing to do, but it did let me determine the max string length
for each of my textboxes, which kept me from writing updates that
couldn't be successfully submitted because of strings that are too
long.

Now I have an ASP.NET client talking to a Web Service which gets it's
data out of a MS SQL Server database. I don't really have the luxury
of having the client ask the database how long it's strings are. So
what's the proper way to get the string maximum length from the DB out
to the client?
 
The web service could return metadata about what it is returning. So it
could return to the client the lengths of all the fields.
 
The same way it's returning the real data. When you query the system tables,
you still just get a bunch of rows back as a result of that query.
 
Marina said:
The same way it's returning the real data. When you query the system tables,
you still just get a bunch of rows back as a result of that query.

Ah, well. I was hoping there was some slightly more magical way, such
as telling the xml to carry it over to the client side. Such is life.
If everything in programming was easy there wouldn't be anything left
to pay me for.
 
Back
Top