I need help and guideliness from you i have an Xaml file to do certain task from excel we take Url,username,Password and trigger the task like login and enter the date from and date to search the report and save in one location.
all detaila i am getting from excel sheet and Now i need to get the all details from my Database table which i was created in my database get the details from there like url,username,password,start date,end date
In my XAML File i have called the {row(Link).ToString ,row(username).ToString,row(password).ToString, } syntax: row (ExcelColumnName).ToString
Now how those values and all handled by DataBase ?
I am not exactly an expert using Databases, so I probably can’t help you that much.
If you search your activities for “Database” you’ll see some activities you can use.
Typically, you will use the “Connect”, “Execute Query”, then “Disconnect”
You will want to make sure you can connect to the database first. Once that is working then you can use the “Execute Query”.
In the Execute Query, you will use query syntax, so you might need to some research on that. Basically, the query code will be in a string, so you would concatenate your values from the excel file to place them in the query string.
Where it says " FROM Master_data …", you need to place the “A” and “Where” inside the string.
" FROM Master_data A Where"+" ((A.Serial_No ='"+
That should get rid of the green and validation error.
Let me know if that helps.
Also, keep in mind that after the “Where” you should only compare columns that are in your Excel file so it can pull in the missing fields from the database. You are including every column from the database to compare with the Excel, so I’m not sure that’s what you want, because usually you will compare with a few columns then pull in the missing fields from the database, like I mentioned.
USED THIS AND ENTER THE COMPLETE QUERY THROWS AN ERROR @ClaytonM
Can you validate the query and say where i have made an mistake to correct that query :
“SELECT Serial_No,User_Name,Password,Start_Date,End_Date,Broker_Id FROM Master_data
Where Serial_No ='”+row(Serial_No).ToString.Trim+“’ AND User_Name
=’”+row(User_Name).ToString.Trim+
“’ AND Password ='”+row(Password).ToString.Trim+“’ AND Start_Date ='”+row(Start_Date).ToString.Trim+“’
AND End_Date='”+row(End_Date).ToString.Trim+“’ AND Broker_Id ='”+row(Broker_Id).ToString.Trim+“'”
Can you provide what the error says?, because that would make it easier to identify the issue.
Also, I assume that all the column names used with row() are variables because you don’t have them as strings.
One thing I would suggest doing is outputting your query string to a text file and checking it to make sure that all the values from the Excel file are coming in correctly.
Oh ok, you still have a validation error.
Can you click Edit Query and post what that looks like?
It doesn’t look like you are using the “_” at the end of each line correctly or formulating your query string.
HI @ClaytonM
I have tried the For each Activity for Loop concepts in that “row in DT” throew an error and in if condition “Late Binding” it means what ?
Please find the error screenshot too below !!
And find the latest Update XAML File Here : MainTwoFiles.xaml (194.3 KB)
kindly help with this issues and we can move forward from this issues here !!
Thanks
RaviDevaRaj
I made a brief look and to resolve those validation errors you can try swapping out the For each to a new one. I think the For each could not change the row to a DataRow for some reason so you got late binding error.
Properties should look like that. When you use a generic For each with a data table, you need to use .AsEnumerable like shown in the image.
The If condition should be resolved by using the System.Data.DataRow as the TypeArgument.