I want to read two columns of data from Excel sheet and I should assign that data to code module variable..please tell me how to write code in c# in ranorex?
Have a look at the user guide Lesson 3: Data-Driven Testing. This lesson explains how to create variables in recording modules. The Section Combining Variables with Test Data covers the part on how to connect those variables with data e.g. from an Excel file.
Since you want to connect data with a code module instead of a recording module, have a look at Lesson 7: Code Modules, section Using Variables with Code Modules. It covers how to create variables in code modules. These can then be connect just like variables from recording modules, as covered in lesson 3.