I wanna select Table Column property using c#. I wrote this code. My query is working on the sqlserver. But i dont get max length in c#.

**My Query Is Here**

```
//TableName:Contents, ColumnName : Title
select Col_Length('Contents','Title') as columnLengthh 

```

**Result Is Here:**

[![enter image description here](https://i.stack.imgur.com/hxXWd.png)](https://i.stack.imgur.com/hxXWd.png)

**My C# Code Here :** 

```
string columnLength = "select Col_Length('Contents','Title') as columnLengthh";
                    adapter = new SqlDataAdapter(columnLength, connection);
                    dataSet = new DataSet();
                    adapter.Fill(dataSet);
                    DataTable dataTable2 = dataSet.Tables[0];
                    foreach (DataRow row in dataTable2.Rows)
                    {
                        var x  = row["columnLengthh"].ToString();
                    }

```

Result (x = -1)

**How i get length in c#.**

**Please help!**