i have used the following code to change the current value for the current field value as
FieldInfo connectionStringField = GetType().BaseType.GetField("_sqlConnectionString", BindingFlags.Instance | BindingFlags.NonPublic);
connectionStringField.SetValue(this, connectionString);
but my query is to get current value of connectionstringfied…
i tried the below code as
getvalue(obj ss);
waiting for your valuable esponses
it throws me null values
If
connectionStringFieldhas found the field (i.e. it is in the base type and is called “_sqlConnectionString”, then it should just be:?
However, using reflection to talk to non-public fields is… unusual.