client-side maximum string length enforcement

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?
 
M

Marina

The web service could return metadata about what it is returning. So it
could return to the client the lengths of all the fields.
 
M

Marina

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.
 
A

apandapion

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top